class ChildProcess::Unix::Lib::FileActions

Public Class Methods

new() click to toggle source
# File lib/childprocess/unix/lib.rb, line 100
def initialize
  @ptr = FFI::MemoryPointer.new(1, Platform::SIZEOF.fetch(:posix_spawn_file_actions_t), false)
  Lib.check Lib.posix_spawn_file_actions_init(@ptr)
end

Public Instance Methods

add_close(fileno) click to toggle source
# File lib/childprocess/unix/lib.rb, line 105
def add_close(fileno)
  Lib.check Lib.posix_spawn_file_actions_addclose(
    @ptr,
    fileno
  )
end
add_dup(fileno, new_fileno) click to toggle source
# File lib/childprocess/unix/lib.rb, line 122
def add_dup(fileno, new_fileno)
  Lib.check Lib.posix_spawn_file_actions_adddup2(
    @ptr,
    fileno,
    new_fileno
  )
end
add_open(fileno, path, oflag, mode) click to toggle source
# File lib/childprocess/unix/lib.rb, line 112
def add_open(fileno, path, oflag, mode)
  Lib.check Lib.posix_spawn_file_actions_addopen(
    @ptr,
    fileno,
    path,
    oflag,
    mode
  )
end
free() click to toggle source
# File lib/childprocess/unix/lib.rb, line 130
def free
  Lib.check Lib.posix_spawn_file_actions_destroy(@ptr)
  @ptr = nil
end
to_ptr() click to toggle source
# File lib/childprocess/unix/lib.rb, line 135
def to_ptr
  @ptr
end