* io.c (pipe_open): argc and argv are not used on win32.
* process.c (rb_spawn_process): remove already useless variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
non-fork environments.
* process.c (rb_exec_err): restore environments after the failure of
exec to fix [ruby-core:44093] [Bug #6249] on non-fork environments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (proc_spawn_n): now uses char ** instead of VALUE *.
* process.c (rb_spawn_process): prog is now VALUE of String, not char *.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
failed. [ruby-core:44093] [ruby-trunk - Bug #6249]
* include/ruby/intern.h (rb_exec_arg): add envp_str and envp_buf field
to store envp of execve().
* process.c (proc_exec_v): takes envp_str as an argument and use it
for execve().
(rb_proc_exec_ne): extended version of rb_proc_exec_n().
(rb_proc_exec_n): use rb_proc_exec_ne().
(rb_proc_exec): follow proc_exec_v() change.
(fill_envp_buf_i): new function.
(rb_exec_arg_fixup): set up envp_str and envp_buf.
(save_env_i): removed.
(save_env): removed.
(rb_run_exec_options_err): don't modify environment variables.
(rb_exec_err): use rb_proc_exec_ne().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Patch by Google Inc. [ruby-core:45073].
* configure.in (RUBY_NACL): New M4 func to configure variables for
NaCl.
(RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names
of Pepper interface types.
(BTESTRUBY): New variable to specify which ruby should be run on
"make btest". NaCl can run the built binary by sel_ldr, but it need
rbconfig.rb. So this variable is distinguished from $MINIRUBY.
* thread_pthread.c: Disabled some features on NaCl.
* io.c: ditto.
* process.c: ditto.
* signal.c: ditto.
* file.c: ditto.
* missing/flock.c: ditto.
* nacl/pepper_main.c: An example implementation of Pepper application
that embeds Ruby.
* nacl/example.html: An example of web page that uses the Pepper
application.
* nacl/nacl-config.rb: Detects variants of NaCl SDK.
* nacl/GNUmakefile.in: Makefile template for NaCl specific build
process.
* nacl/package.rb: script for packaging a NaCl-Ruby embedding
application.
* nacl/reate_nmf.rb: Wrapper script of create_nmf.py
* dln.c (dln_load): Added a hack to call on NaCl.
* util.c (ruby_getcwd): Path to the current directort is not available
on NaCl.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
new function.
* process.c (enum): add EXEC_OPTION_PGROUP and move the position
above for the usage in proc_spawn_n().
* process.c (proc_spawn_n): add an argument to pass new option
`new_pgroup`. The option specifies CREATE_NEW_PROCESS_GROUP flag to
CreateProcessW(). This flag is necessary for the usage of
Process.kill on the subprocess on Windows.
* process.c (rb_exec_arg_addopt): ditto.
* process.c (rb_spawn_process): ditto.
* process.c (documentation for rb_f_spawn): add documentation for new
option `new_pgroup` of spawn.
* test/ruby/test_process.rb (TestProcess#test_execopts_new_pgroup):
add tests for option `new_pgroup`.
* test/ruby/test_thread.rb
(TestThreadGroup#test_thread_timer_and_interrupt):
add option `new_pgroup: true` to spawn on Windows. It's needed for
Process.kill on a subprocess.
* win32/win32.c (CreateChild): add an argument to pass
dwCreationFlags of CreateProcessW().
* win32/win32.c (rb_w32_spawn): ditto.
* win32/win32.c (rb_w32_aspawn_flags): add new function to pass
dwCreationFlags.
* win32/win32.c (rb_w32_aspawn): refactor to move the content to
rb_w32_aspawn_flags().
[ruby-core:43245][Bug #6131]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
relative pathnames from the current directory of the parent process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78
* dln_find.c: remove useless replacement of free.
* ext/readline/readline.c (readline_attempted_completion_function):
strings for readline must allocated with malloc.
* process.c (run_exec_dup2): use free; see also r20950.
* re.c (onig_new_with_source): use malloc for oniguruma.
* vm.c (ruby_vm_destruct): use free for VMs.
* vm.c (thread_free): use free for threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
spawned process.
* process.c (proc_spawn_v): fix missing argument, and try with
/bin/sh only if failed with ENOEXEC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
no waiting thread. If there are 2 or more runnable threads,
the timer thread does polling. Avoid polling makes power save
for several computers (0.2W per a Ruby process, when I measured).
If outside-event such as signal or Thread#kill was occuerred
when the timer thread does not do polling, then wake-up
the timer thread using communication-pipe (the timer thread
waits this communication-pipe with select(2)).
The discussion about this modification can be found from the post
[ruby-core:33456] and other related posts.
Note that Eric Wong and KOSAKI Motohiro give us the huge
contributions for this modification. Thanks.
* thread_pthread.c (rb_thread_wakeup_timer_thread): add a function.
This function wakes up the timer thread using communication-pipe.
* thread.c (rb_thread_stop_timer_thread): add a parameter which
specify closing communication-pipe or not.
* thread.c (rb_thread_terminate_all): do not stop timer thread here
(ruby_cleanup() terminate timer thread).
* signal.c: wake up timer thread using
rb_thread_wakeup_timer_thread() from signal handler.
* eval.c (ruby_cleanup): use rb_thread_stop_timer_thread(1).
* process.c: use rb_thread_stop_timer_thread(0)
(reuse communication-pipe).
* thread_win32.c (rb_thread_wakeup_timer_thread): add a dummy
function.
* vm_core.h: add and fix decl. of functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for avoiding a race.
* process.c (sig_do_nothing): new function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before calling execve(). Because r31760 reintroduced an issue that
system() may hang up (i.e. [ruby-dev:12261]).
* process.c (save_sigpipe, restore_sigpipe): new.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e