Class: ChildProcess::Unix::PosixSpawnProcess::Envp

### Home Classes Methods

### In Files

- lib/childprocess/unix/posix_spawn_process.rb

### Parent

Object

### Methods

- ::new
- #to_ptr

### Class/Module Index

Quicksearch

- ChildProcess
- ChildProcess::AbstractIO
- ChildProcess::AbstractProcess
- ChildProcess::Error
- ChildProcess::InvalidEnvironmentVariable
- ChildProcess::JRuby
- ChildProcess::JRuby::IO
- ChildProcess::JRuby::Process
- ChildProcess::JRuby::Pump
- ChildProcess::LaunchError
- ChildProcess::MissingPlatformError
- ChildProcess::SubclassResponsibility
- ChildProcess::TimeoutError
- ChildProcess::Tools
- ChildProcess::Tools::Generator
- ChildProcess::Unix
- ChildProcess::Unix::ForkExecProcess
- ChildProcess::Unix::IO
- ChildProcess::Unix::Lib
- ChildProcess::Unix::Lib::Attrs
- ChildProcess::Unix::Lib::FileActions
- ChildProcess::Unix::Platform
- ChildProcess::Unix::PosixSpawnProcess
- ChildProcess::Unix::PosixSpawnProcess::Argv
- ChildProcess::Unix::PosixSpawnProcess::Envp
- ChildProcess::Unix::Process
- ChildProcess::Windows
- ChildProcess::Windows::Handle
- ChildProcess::Windows::IO
- ChildProcess::Windows::IoCounters
- ChildProcess::Windows::JobObjectBasicLimitInformation
- ChildProcess::Windows::JobObjectExtendedLimitInformation
- ChildProcess::Windows::Lib
- ChildProcess::Windows::Process
- ChildProcess::Windows::Process::Job
- ChildProcess::Windows::ProcessBuilder
- ChildProcess::Windows::ProcessInfo
- ChildProcess::Windows::SecurityAttributes
- ChildProcess::Windows::StartupInfo
- Java
- Java::JavaIo
- Java::JavaIo::FileDescriptor
- Java::SunNioCh
- Java::SunNioCh::FileChannelImpl
- FFI
- FFI::MemoryPointer

No matching classes.

# ChildProcess::Unix::PosixSpawnProcess::Envp

### Public Class Methods

new(env) click to toggle source

    # File lib/childprocess/unix/posix_spawn_process.rb, line 110
    def initialize(env)
      @ptrs = env.map do |key, val|
        next if val.nil?

        if key =~ /=|\00// || val.include?("\00"")
          raise InvalidEnvironmentVariable, "#{key.inspect} => #{val.inspect}"
        end

        FFI::MemoryPointer.from_string("#{key}=#{val}")
      end.compact

      @ptrs << FFI::Pointer.new(0)
    end

### Public Instance Methods

to_ptr() click to toggle source

    # File lib/childprocess/unix/posix_spawn_process.rb, line 124
    def to_ptr
      env = FFI::MemoryPointer.new(:pointer, @ptrs.size)
      env.put_array_of_pointer(0, @ptrs)

      env
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.