class Aggkit::ChildProcess::Unix::Lib::FileActions

Public Class Methods

new() click to toggle source
# File lib/aggkit/childprocess/unix/lib.rb, line 102
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/aggkit/childprocess/unix/lib.rb, line 107
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/aggkit/childprocess/unix/lib.rb, line 124
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/aggkit/childprocess/unix/lib.rb, line 114
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/aggkit/childprocess/unix/lib.rb, line 132
def free
  Lib.check Lib.posix_spawn_file_actions_destroy(@ptr)
  @ptr = nil
end
to_ptr() click to toggle source
# File lib/aggkit/childprocess/unix/lib.rb, line 137
def to_ptr
  @ptr
end