lib/childprocess/unix/lib.rb in childprocess-0.2.8 vs lib/childprocess/unix/lib.rb in childprocess-0.2.9
- old
+ new
@@ -1,10 +1,19 @@
+
module ChildProcess
module Unix
module Lib
extend FFI::Library
-
ffi_lib FFI::Library::LIBC
+
+ if ChildProcess.os == :macosx
+ attach_function :_NSGetEnviron, [], :pointer
+ def self.environ
+ _NSGetEnviron().read_pointer
+ end
+ elsif respond_to? :attach_variable
+ attach_variable :environ, :pointer
+ end
attach_function :strerror, [:int], :string
# int posix_spawnp(
# pid_t *restrict pid,