childprocess 4.1.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +32 -0
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile +3 -2
  5. data/README.md +5 -23
  6. data/childprocess.gemspec +2 -0
  7. data/lib/childprocess/abstract_process.rb +1 -1
  8. data/lib/childprocess/errors.rb +0 -21
  9. data/lib/childprocess/process_spawn_process.rb +127 -0
  10. data/lib/childprocess/unix/process.rb +3 -64
  11. data/lib/childprocess/unix.rb +2 -4
  12. data/lib/childprocess/version.rb +1 -1
  13. data/lib/childprocess/windows/process.rb +13 -116
  14. data/lib/childprocess/windows.rb +0 -29
  15. data/lib/childprocess.rb +16 -53
  16. data/spec/childprocess_spec.rb +39 -15
  17. data/spec/io_spec.rb +1 -1
  18. data/spec/spec_helper.rb +5 -20
  19. data/spec/unix_spec.rb +3 -7
  20. metadata +19 -24
  21. data/.travis.yml +0 -37
  22. data/appveyor.yml +0 -36
  23. data/lib/childprocess/jruby/io.rb +0 -16
  24. data/lib/childprocess/jruby/process.rb +0 -184
  25. data/lib/childprocess/jruby/pump.rb +0 -53
  26. data/lib/childprocess/jruby.rb +0 -56
  27. data/lib/childprocess/tools/generator.rb +0 -146
  28. data/lib/childprocess/unix/fork_exec_process.rb +0 -78
  29. data/lib/childprocess/unix/lib.rb +0 -186
  30. data/lib/childprocess/unix/platform/arm64-macosx.rb +0 -11
  31. data/lib/childprocess/unix/platform/i386-linux.rb +0 -12
  32. data/lib/childprocess/unix/platform/i386-solaris.rb +0 -11
  33. data/lib/childprocess/unix/platform/x86_64-linux.rb +0 -12
  34. data/lib/childprocess/unix/platform/x86_64-macosx.rb +0 -11
  35. data/lib/childprocess/unix/posix_spawn_process.rb +0 -134
  36. data/lib/childprocess/windows/handle.rb +0 -91
  37. data/lib/childprocess/windows/lib.rb +0 -416
  38. data/lib/childprocess/windows/process_builder.rb +0 -178
  39. data/lib/childprocess/windows/structs.rb +0 -149
  40. data/spec/jruby_spec.rb +0 -24
@@ -1,184 +0,0 @@
1
- require "java"
2
-
3
- module ChildProcess
4
- module JRuby
5
- class Process < AbstractProcess
6
- def initialize(args)
7
- super(args)
8
-
9
- @pumps = []
10
- end
11
-
12
- def io
13
- @io ||= JRuby::IO.new
14
- end
15
-
16
- def exited?
17
- return true if @exit_code
18
-
19
- assert_started
20
- @exit_code = @process.exitValue
21
- stop_pumps
22
-
23
- true
24
- rescue java.lang.IllegalThreadStateException => ex
25
- log(ex.class => ex.message)
26
- false
27
- ensure
28
- log(:exit_code => @exit_code)
29
- end
30
-
31
- def stop(timeout = nil)
32
- assert_started
33
-
34
- @process.destroy
35
- wait # no way to actually use the timeout here..
36
- end
37
-
38
- def wait
39
- if exited?
40
- exit_code
41
- else
42
- @process.waitFor
43
-
44
- stop_pumps
45
- @exit_code = @process.exitValue
46
- end
47
- end
48
-
49
- # Implementation of ChildProcess::JRuby::Process#pid depends heavily on
50
- # what Java SDK is being used; here, we look it up once at load, then
51
- # define the method once to avoid runtime overhead.
52
- normalised_java_version_major = java.lang.System.get_property("java.version")
53
- .slice(/^(1\.)?([0-9]+)/, 2)
54
- .to_i
55
- if normalised_java_version_major >= 9
56
-
57
- # On modern Javas, we can simply delegate through to `Process#pid`,
58
- # which was introduced in Java 9.
59
- #
60
- # @return [Integer] the pid of the process after it has started
61
- # @raise [NotImplementedError] when trying to access pid on platform for
62
- # which it is unsupported in Java
63
- def pid
64
- @process.pid
65
- rescue java.lang.UnsupportedOperationException => e
66
- raise NotImplementedError, "pid is not supported on this platform: #{e.message}"
67
- end
68
-
69
- else
70
-
71
- # On Legacy Javas, fall back to reflection.
72
- #
73
- # Only supported in JRuby on a Unix operating system, thanks to limitations
74
- # in Java's classes
75
- #
76
- # @return [Integer] the pid of the process after it has started
77
- # @raise [NotImplementedError] when trying to access pid on non-Unix platform
78
- #
79
- def pid
80
- if @process.getClass.getName != "java.lang.UNIXProcess"
81
- raise NotImplementedError, "pid is only supported by JRuby child processes on Unix"
82
- end
83
-
84
- # About the best way we can do this is with a nasty reflection-based impl
85
- # Thanks to Martijn Courteaux
86
- # http://stackoverflow.com/questions/2950338/how-can-i-kill-a-linux-process-in-java-with-sigkill-process-destroy-does-sigter/2951193#2951193
87
- field = @process.getClass.getDeclaredField("pid")
88
- field.accessible = true
89
- field.get(@process)
90
- end
91
-
92
- end
93
-
94
- private
95
-
96
- def launch_process(&blk)
97
- pb = java.lang.ProcessBuilder.new(@args)
98
-
99
- pb.directory java.io.File.new(@cwd || Dir.pwd)
100
- set_env pb.environment
101
-
102
- begin
103
- @process = pb.start
104
- rescue java.io.IOException => ex
105
- raise LaunchError, ex.message
106
- end
107
-
108
- setup_io
109
- end
110
-
111
- def setup_io
112
- if @io
113
- redirect(@process.getErrorStream, @io.stderr)
114
- redirect(@process.getInputStream, @io.stdout)
115
- else
116
- @process.getErrorStream.close
117
- @process.getInputStream.close
118
- end
119
-
120
- if duplex?
121
- io._stdin = create_stdin
122
- else
123
- @process.getOutputStream.close
124
- end
125
- end
126
-
127
- def redirect(input, output)
128
- if output.nil?
129
- input.close
130
- return
131
- end
132
-
133
- @pumps << Pump.new(input, output.to_outputstream).run
134
- end
135
-
136
- def stop_pumps
137
- @pumps.each { |pump| pump.stop }
138
- end
139
-
140
- def set_env(env)
141
- merged = ENV.to_hash
142
-
143
- @environment.each { |k, v| merged[k.to_s] = v }
144
-
145
- merged.each do |k, v|
146
- if v
147
- env.put(k, v.to_s)
148
- elsif env.has_key? k
149
- env.remove(k)
150
- end
151
- end
152
-
153
- removed_keys = env.key_set.to_a - merged.keys
154
- removed_keys.each { |k| env.remove(k) }
155
- end
156
-
157
- def create_stdin
158
- output_stream = @process.getOutputStream
159
-
160
- stdin = output_stream.to_io
161
- stdin.sync = true
162
- stdin.instance_variable_set(:@childprocess_java_stream, output_stream)
163
-
164
- class << stdin
165
- # The stream provided is a BufferedeOutputStream, so we
166
- # have to flush it to make the bytes flow to the process
167
- def __childprocess_flush__
168
- @childprocess_java_stream.flush
169
- end
170
-
171
- [:flush, :print, :printf, :putc, :puts, :write, :write_nonblock].each do |m|
172
- define_method(m) do |*args|
173
- super(*args)
174
- self.__childprocess_flush__
175
- end
176
- end
177
- end
178
-
179
- stdin
180
- end
181
-
182
- end # Process
183
- end # JRuby
184
- end # ChildProcess
@@ -1,53 +0,0 @@
1
- module ChildProcess
2
- module JRuby
3
- class Pump
4
- BUFFER_SIZE = 2048
5
-
6
- def initialize(input, output)
7
- @input = input
8
- @output = output
9
- @stop = false
10
- end
11
-
12
- def stop
13
- @stop = true
14
- @thread && @thread.join
15
- end
16
-
17
- def run
18
- @thread = Thread.new { pump }
19
-
20
- self
21
- end
22
-
23
- private
24
-
25
- def pump
26
- buffer = Java.byte[BUFFER_SIZE].new
27
-
28
- until @stop && (@input.available == 0)
29
- read, avail = 0, 0
30
-
31
- while read != -1
32
- avail = [@input.available, 1].max
33
- avail = BUFFER_SIZE if avail > BUFFER_SIZE
34
- read = @input.read(buffer, 0, avail)
35
-
36
- if read > 0
37
- @output.write(buffer, 0, read)
38
- @output.flush
39
- end
40
- end
41
-
42
- sleep 0.1
43
- end
44
-
45
- @output.flush
46
- rescue java.io.IOException => ex
47
- ChildProcess.logger.debug ex.message
48
- ChildProcess.logger.debug ex.backtrace
49
- end
50
-
51
- end # Pump
52
- end # JRuby
53
- end # ChildProcess
@@ -1,56 +0,0 @@
1
- require 'java'
2
- require 'jruby'
3
-
4
- class Java::SunNioCh::FileChannelImpl
5
- field_reader :fd
6
- end
7
-
8
- class Java::JavaIo::FileDescriptor
9
- if ChildProcess.os == :windows
10
- field_reader :handle
11
- end
12
-
13
- field_reader :fd
14
- end
15
-
16
- module ChildProcess
17
- module JRuby
18
- def self.posix_fileno_for(obj)
19
- channel = ::JRuby.reference(obj).channel
20
- begin
21
- channel.getFDVal
22
- rescue NoMethodError
23
- fileno = channel.fd
24
- if fileno.kind_of?(Java::JavaIo::FileDescriptor)
25
- fileno = fileno.fd
26
- end
27
-
28
- fileno == -1 ? obj.fileno : fileno
29
- end
30
- rescue
31
- # fall back
32
- obj.fileno
33
- end
34
-
35
- def self.windows_handle_for(obj)
36
- channel = ::JRuby.reference(obj).channel
37
- fileno = obj.fileno
38
-
39
- begin
40
- fileno = channel.getFDVal
41
- rescue NoMethodError
42
- fileno = channel.fd if channel.respond_to?(:fd)
43
- end
44
-
45
- if fileno.kind_of? Java::JavaIo::FileDescriptor
46
- fileno.handle
47
- else
48
- Windows::Lib.handle_for fileno
49
- end
50
- end
51
- end
52
- end
53
-
54
- require "childprocess/jruby/pump"
55
- require "childprocess/jruby/io"
56
- require "childprocess/jruby/process"
@@ -1,146 +0,0 @@
1
- require 'fileutils'
2
-
3
- module ChildProcess
4
- module Tools
5
- class Generator
6
- EXE_NAME = "childprocess-sizeof-generator"
7
- TMP_PROGRAM = "childprocess-sizeof-generator.c"
8
- DEFAULT_INCLUDES = %w[stdio.h stddef.h]
9
-
10
- def self.generate
11
- new.generate
12
- end
13
-
14
- def initialize
15
- @cc = ENV['CC'] || 'gcc'
16
- @out = File.expand_path("../../unix/platform/#{ChildProcess.platform_name}.rb", __FILE__)
17
- @sizeof = {}
18
- @constants = {}
19
- end
20
-
21
- def generate
22
- fetch_size 'posix_spawn_file_actions_t', :include => "spawn.h"
23
- fetch_size 'posix_spawnattr_t', :include => "spawn.h"
24
- fetch_size 'sigset_t', :include => "signal.h"
25
-
26
- fetch_constant 'POSIX_SPAWN_RESETIDS', :include => 'spawn.h'
27
- fetch_constant 'POSIX_SPAWN_SETPGROUP', :include => 'spawn.h'
28
- fetch_constant 'POSIX_SPAWN_SETSIGDEF', :include => 'spawn.h'
29
- fetch_constant 'POSIX_SPAWN_SETSIGMASK', :include => 'spawn.h'
30
-
31
- if ChildProcess.linux?
32
- fetch_constant 'POSIX_SPAWN_USEVFORK', :include => 'spawn.h', :define => {'_GNU_SOURCE' => nil}
33
- end
34
-
35
- write
36
- end
37
-
38
- def write
39
- FileUtils.mkdir_p(File.dirname(@out))
40
- File.open(@out, 'w') do |io|
41
- io.puts result
42
- end
43
-
44
- puts "wrote #{@out}"
45
- end
46
-
47
- def fetch_size(type_name, opts = {})
48
- print "sizeof(#{type_name}): "
49
- src = <<-EOF
50
- int main() {
51
- printf("%d", (unsigned int)sizeof(#{type_name}));
52
- return 0;
53
- }
54
- EOF
55
-
56
- output = execute(src, opts)
57
-
58
- if output.to_i < 1
59
- raise "sizeof(#{type_name}) == #{output.to_i} (output=#{output})"
60
- end
61
-
62
- size = output.to_i
63
- @sizeof[type_name] = size
64
-
65
- puts size
66
- end
67
-
68
- def fetch_constant(name, opts)
69
- print "#{name}: "
70
- src = <<-EOF
71
- int main() {
72
- printf("%d", (unsigned int)#{name});
73
- return 0;
74
- }
75
- EOF
76
-
77
- output = execute(src, opts)
78
- value = Integer(output)
79
- @constants[name] = value
80
-
81
- puts value
82
- end
83
-
84
-
85
- def execute(src, opts)
86
- program = Array(opts[:define]).map do |key, value|
87
- <<-SRC
88
- #ifndef #{key}
89
- #define #{key} #{value}
90
- #endif
91
- SRC
92
- end.join("\n")
93
- program << "\n"
94
-
95
- includes = Array(opts[:include]) + DEFAULT_INCLUDES
96
- program << includes.map { |include| "#include <#{include}>" }.join("\n")
97
- program << "\n#{src}"
98
-
99
- File.open(TMP_PROGRAM, 'w') do |file|
100
- file << program
101
- end
102
-
103
- cmd = "#{@cc} #{TMP_PROGRAM} -o #{EXE_NAME}"
104
- system cmd
105
- unless $?.success?
106
- raise "failed to compile program: #{cmd.inspect}\n#{program}"
107
- end
108
-
109
- output = `./#{EXE_NAME} 2>&1`
110
-
111
- unless $?.success?
112
- raise "failed to run program: #{cmd.inspect}\n#{output}"
113
- end
114
-
115
- output.chomp
116
- ensure
117
- File.delete TMP_PROGRAM if File.exist?(TMP_PROGRAM)
118
- File.delete EXE_NAME if File.exist?(EXE_NAME)
119
- end
120
-
121
- def result
122
- if @sizeof.empty? && @constants.empty?
123
- raise "no data collected, nothing to do"
124
- end
125
-
126
- out = ['module ChildProcess::Unix::Platform']
127
- out << ' SIZEOF = {'
128
-
129
- max = @sizeof.keys.map { |e| e.length }.max
130
- @sizeof.each_with_index do |(type, size), idx|
131
- out << " :#{type.ljust max} => #{size}#{',' unless idx == @sizeof.size - 1}"
132
- end
133
- out << ' }'
134
-
135
- max = @constants.keys.map { |e| e.length }.max
136
- @constants.each do |name, val|
137
- out << " #{name.ljust max} = #{val}"
138
- end
139
- out << 'end'
140
-
141
- out.join "\n"
142
- end
143
-
144
- end
145
- end
146
- end
@@ -1,78 +0,0 @@
1
- module ChildProcess
2
- module Unix
3
- class ForkExecProcess < Process
4
- private
5
-
6
- def launch_process
7
- if @io
8
- stdout = @io.stdout
9
- stderr = @io.stderr
10
- end
11
-
12
- # pipe used to detect exec() failure
13
- exec_r, exec_w = ::IO.pipe
14
- ChildProcess.close_on_exec exec_w
15
-
16
- if duplex?
17
- reader, writer = ::IO.pipe
18
- end
19
-
20
- @pid = Kernel.fork {
21
- # Children of the forked process will inherit its process group
22
- # This is to make sure that all grandchildren dies when this Process instance is killed
23
- ::Process.setpgid 0, 0 if leader?
24
-
25
- if @cwd
26
- Dir.chdir(@cwd)
27
- end
28
-
29
- exec_r.close
30
- set_env
31
-
32
- if stdout
33
- STDOUT.reopen(stdout)
34
- else
35
- STDOUT.reopen("/dev/null", "a+")
36
- end
37
- if stderr
38
- STDERR.reopen(stderr)
39
- else
40
- STDERR.reopen("/dev/null", "a+")
41
- end
42
-
43
- if duplex?
44
- STDIN.reopen(reader)
45
- writer.close
46
- end
47
-
48
- executable, *args = @args
49
-
50
- begin
51
- Kernel.exec([executable, executable], *args)
52
- rescue SystemCallError => ex
53
- exec_w << ex.message
54
- end
55
- }
56
-
57
- exec_w.close
58
-
59
- if duplex?
60
- io._stdin = writer
61
- reader.close
62
- end
63
-
64
- # if we don't eventually get EOF, exec() failed
65
- unless exec_r.eof?
66
- raise LaunchError, exec_r.read || "executing command with #{@args.inspect} failed"
67
- end
68
-
69
- ::Process.detach(@pid) if detach?
70
- end
71
-
72
- def set_env
73
- @environment.each { |k, v| ENV[k.to_s] = v.nil? ? nil : v.to_s }
74
- end
75
-
76
- end # Process
77
- end # Unix
78
- end # ChildProcess
@@ -1,186 +0,0 @@
1
- module ChildProcess
2
- module Unix
3
- module Lib
4
- extend FFI::Library
5
- ffi_lib FFI::Library::LIBC
6
-
7
- if ChildProcess.os == :macosx
8
- attach_function :_NSGetEnviron, [], :pointer
9
- def self.environ
10
- _NSGetEnviron().read_pointer
11
- end
12
- elsif respond_to? :attach_variable
13
- attach_variable :environ, :pointer
14
- end
15
-
16
- attach_function :strerror, [:int], :string
17
- attach_function :chdir, [:string], :int
18
- attach_function :fcntl, [:int, :int, :int], :int # fcntl actually takes varags, but we only need this version.
19
-
20
- # int posix_spawnp(
21
- # pid_t *restrict pid,
22
- # const char *restrict file,
23
- # const posix_spawn_file_actions_t *file_actions,
24
- # const posix_spawnattr_t *restrict attrp,
25
- # char *const argv[restrict],
26
- # char *const envp[restrict]
27
- # );
28
-
29
- attach_function :posix_spawnp, [
30
- :pointer,
31
- :string,
32
- :pointer,
33
- :pointer,
34
- :pointer,
35
- :pointer
36
- ], :int
37
-
38
- # int posix_spawn_file_actions_init(posix_spawn_file_actions_t *file_actions);
39
- attach_function :posix_spawn_file_actions_init, [:pointer], :int
40
-
41
- # int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *file_actions);
42
- attach_function :posix_spawn_file_actions_destroy, [:pointer], :int
43
-
44
- # int posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *file_actions, int filedes);
45
- attach_function :posix_spawn_file_actions_addclose, [:pointer, :int], :int
46
-
47
- # int posix_spawn_file_actions_addopen(
48
- # posix_spawn_file_actions_t *restrict file_actions,
49
- # int filedes,
50
- # const char *restrict path,
51
- # int oflag,
52
- # mode_t mode
53
- # );
54
- attach_function :posix_spawn_file_actions_addopen, [:pointer, :int, :string, :int, :mode_t], :int
55
-
56
- # int posix_spawn_file_actions_adddup2(
57
- # posix_spawn_file_actions_t *file_actions,
58
- # int filedes,
59
- # int newfiledes
60
- # );
61
- attach_function :posix_spawn_file_actions_adddup2, [:pointer, :int, :int], :int
62
-
63
- # int posix_spawnattr_init(posix_spawnattr_t *attr);
64
- attach_function :posix_spawnattr_init, [:pointer], :int
65
-
66
- # int posix_spawnattr_destroy(posix_spawnattr_t *attr);
67
- attach_function :posix_spawnattr_destroy, [:pointer], :int
68
-
69
- # int posix_spawnattr_setflags(posix_spawnattr_t *attr, short flags);
70
- attach_function :posix_spawnattr_setflags, [:pointer, :short], :int
71
-
72
- # int posix_spawnattr_getflags(const posix_spawnattr_t *restrict attr, short *restrict flags);
73
- attach_function :posix_spawnattr_getflags, [:pointer, :pointer], :int
74
-
75
- # int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgroup);
76
- attach_function :posix_spawnattr_setpgroup, [:pointer, :pid_t], :int
77
-
78
- # int posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict attr, pid_t *restrict pgroup);
79
- attach_function :posix_spawnattr_getpgroup, [:pointer, :pointer], :int
80
-
81
- # int posix_spawnattr_setsigdefault(posix_spawnattr_t *restrict attr, const sigset_t *restrict sigdefault);
82
- attach_function :posix_spawnattr_setsigdefault, [:pointer, :pointer], :int
83
-
84
- # int posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict attr, sigset_t *restrict sigdefault);
85
- attach_function :posix_spawnattr_getsigdefault, [:pointer, :pointer], :int
86
-
87
- # int posix_spawnattr_setsigmask(posix_spawnattr_t *restrict attr, const sigset_t *restrict sigmask);
88
- attach_function :posix_spawnattr_setsigmask, [:pointer, :pointer], :int
89
-
90
- # int posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict attr, sigset_t *restrict sigmask);
91
- attach_function :posix_spawnattr_getsigmask, [:pointer, :pointer], :int
92
-
93
- def self.check(errno)
94
- if errno != 0
95
- raise Error, Lib.strerror(FFI.errno)
96
- end
97
- end
98
-
99
- class FileActions
100
- def initialize
101
- @ptr = FFI::MemoryPointer.new(1, Platform::SIZEOF.fetch(:posix_spawn_file_actions_t), false)
102
- Lib.check Lib.posix_spawn_file_actions_init(@ptr)
103
- end
104
-
105
- def add_close(fileno)
106
- Lib.check Lib.posix_spawn_file_actions_addclose(
107
- @ptr,
108
- fileno
109
- )
110
- end
111
-
112
- def add_open(fileno, path, oflag, mode)
113
- Lib.check Lib.posix_spawn_file_actions_addopen(
114
- @ptr,
115
- fileno,
116
- path,
117
- oflag,
118
- mode
119
- )
120
- end
121
-
122
- def add_dup(fileno, new_fileno)
123
- Lib.check Lib.posix_spawn_file_actions_adddup2(
124
- @ptr,
125
- fileno,
126
- new_fileno
127
- )
128
- end
129
-
130
- def free
131
- Lib.check Lib.posix_spawn_file_actions_destroy(@ptr)
132
- @ptr = nil
133
- end
134
-
135
- def to_ptr
136
- @ptr
137
- end
138
- end # FileActions
139
-
140
- class Attrs
141
- def initialize
142
- @ptr = FFI::MemoryPointer.new(1, Platform::SIZEOF.fetch(:posix_spawnattr_t), false)
143
- Lib.check Lib.posix_spawnattr_init(@ptr)
144
- end
145
-
146
- def free
147
- Lib.check Lib.posix_spawnattr_destroy(@ptr)
148
- @ptr = nil
149
- end
150
-
151
- def flags=(flags)
152
- Lib.check Lib.posix_spawnattr_setflags(@ptr, flags)
153
- end
154
-
155
- def flags
156
- ptr = FFI::MemoryPointer.new(:short)
157
- Lib.check Lib.posix_spawnattr_getflags(@ptr, ptr)
158
-
159
- ptr.read_short
160
- end
161
-
162
- def pgroup=(pid)
163
- self.flags |= Platform::POSIX_SPAWN_SETPGROUP
164
- Lib.check Lib.posix_spawnattr_setpgroup(@ptr, pid)
165
- end
166
-
167
- def to_ptr
168
- @ptr
169
- end
170
- end # Attrs
171
-
172
- end
173
- end
174
- end
175
-
176
- # missing on rubinius
177
- class FFI::MemoryPointer
178
- unless method_defined?(:from_string)
179
- def self.from_string(str)
180
- ptr = new(1, str.bytesize + 1)
181
- ptr.write_string("#{str}\0")
182
-
183
- ptr
184
- end
185
- end
186
- end
@@ -1,11 +0,0 @@
1
- module ChildProcess::Unix::Platform
2
- SIZEOF = {
3
- :posix_spawn_file_actions_t => 8,
4
- :posix_spawnattr_t => 8,
5
- :sigset_t => 4
6
- }
7
- POSIX_SPAWN_RESETIDS = 1
8
- POSIX_SPAWN_SETPGROUP = 2
9
- POSIX_SPAWN_SETSIGDEF = 4
10
- POSIX_SPAWN_SETSIGMASK = 8
11
- end