* process.c (getresuid): Defined for AIX.
(getresgid): Ditto
AIX don't have getresuid/getresgid but getuidx/getgidx.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
vfork() is still faster than fork() especially when the parent
process uses big memory.
ruby -rbenchmark -e 'a = "a" * 1_000_000_000; puts Benchmark.measure { system("true") }'
fork: 0.000000 0.010000 0.010000 ( 0.014968)
vfork: 0.000000 0.000000 0.000000 ( 0.000912)
on Debian sid.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
retry_fork respect to rb_fork_async_signal_safe.
(retry_fork_ruby): Specialized version of retry_fork respect to
rb_fork_ruby.
(rb_fork_ruby): Removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (rlimit_resource_type, rlimit_resource_value): get rid
of function calls in RSTRING_PTR(), as it evaluates the argument
twice.
* re.c (match_backref_number): ditto.
* signal.c (esignal_init, rb_f_kill, trap_signm): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (open): use UTF-8 version function to support
non-ascii path properly. [ruby-core:63185] [Bug #9946]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (run_exec_open): use a local variable to get rid of
RARRAY_AREF() is evaluated multiple times by RSTRING_PTR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (check_exec_redirect): use RB_TYPE_P instead of single
comparison of TYPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(OBJ2GID1): Defined even if getgrnam_r is not usable.
This fixes compilation error on Android.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r()
may need larger buffers than sysconf values, so retry with
expanding the buffer when ERANGE is returned.
[ruby-core:61325] [Bug #9600]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (obj2uid, obj2gid): need capacity as buffer size, not
length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (GETPW_R_SIZE_INIT, GETGR_R_SIZE_INIT): sysconf values
are not maximum sizes, but initial sizes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (OBJ2UID1, OBJ2GID1): separate from OBJ2UID and
OBJ2GID respectively, need given buffers.
* process.c (OBJ2UID, OBJ2GID): no longer need PREPARE_GETPWNAM
and PREPARE_GETGRNAM.
* process.c (obj2uid, obj2gid): use tmp buffer instead of alloca
to get rid of potential stack overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
0001-process.c-avoid-EINTR-from-Process.spawn.patch written by
Eric Wong in [Bug #8770].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (send_child_error): retry write on EINTR to fix
occasional Errno::EINTR from Process.spawn.
* process.c (recv_child_error): retry read on EINTR to fix
occasional Errno::EINTR from Process.spawn.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
signal is sent to the parent process while Ruby is forking in IO.popen.
Patch by Scott Francis. Closes GH-513.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (rb_execarg_fixup): use RHASH_TBL_RAW and insert write
barriers where appropriate
* vm.c (kwmerge_i): use RHASH_TBL_RAW
* vm.c (HASH_ASET): use rb_hash_aset instead of calling directly into
st_insert
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
argument list of rb_block_call_func.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c (Init_process): rename Struct::Tms as Process::Tms. keep
the former defined for the backward compatibility, for the time
being.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e