Class: ChildProcess::Unix::Lib::Attrs

Inherits:
Object
  • Object
show all
Defined in:
lib/childprocess/unix/lib.rb

Overview

FileActions

Instance Method Summary collapse

Constructor Details

#initializeAttrs

Returns a new instance of Attrs.



140
141
142
143
# File 'lib/childprocess/unix/lib.rb', line 140

def initialize
  @ptr = FFI::MemoryPointer.new(1, Platform::SIZEOF.fetch(:posix_spawnattr_t), false)
  Lib.check Lib.posix_spawnattr_init(@ptr)
end

Instance Method Details

#flagsObject



154
155
156
157
158
159
# File 'lib/childprocess/unix/lib.rb', line 154

def flags
  ptr = FFI::MemoryPointer.new(:short)
  Lib.check Lib.posix_spawnattr_getflags(@ptr, ptr)

  ptr.read_short
end

#flags=(flags) ⇒ Object



150
151
152
# File 'lib/childprocess/unix/lib.rb', line 150

def flags=(flags)
  Lib.check Lib.posix_spawnattr_setflags(@ptr, flags)
end

#freeObject



145
146
147
148
# File 'lib/childprocess/unix/lib.rb', line 145

def free
  Lib.check Lib.posix_spawnattr_destroy(@ptr)
  @ptr = nil
end

#to_ptrObject



161
162
163
# File 'lib/childprocess/unix/lib.rb', line 161

def to_ptr
  @ptr
end