Граф коммитов

368 Коммитов

Автор SHA1 Сообщение Дата
kosaki 57da3d94aa comment clarification. Only Leopard or earlier has ENOTSUPP
issue if my kernel code reading is correct.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 04:18:09 +00:00
naruse 41ab31e67a * process.c (rb_daemon): fix wrong #endif position.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-28 01:20:23 +00:00
ko1 d1d5d5e798 * thread_pthread.c: Stop polling in the timer thread when there are
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
2011-06-27 00:30:41 +00:00
nobu 706335aa0b * process.c (proc_daemon): should not start timer thread
twice.  fixed Bug#4920.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-24 08:06:38 +00:00
kosaki 1d110a14a4 * process.c (before_exec): use sig_do_nothing instead of SIG_DFL
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
2011-06-20 13:55:04 +00:00
akr 7da3ea811e * method.h, internal.h iseq.h: declare internal functions.
* 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
2011-06-18 03:49:33 +00:00
akr e7996eb3cc * internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.

* iseq.h: declare rb_iseq_t dependent internal functions here.

* vm_core.h: declare rb_thread_t dependent internal functions here.

* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
  enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
  iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
  proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
  thread.c, time.c, transcode.c, variable.c, vm.c,
  tool/compile_prelude.rb: don't declare internal functions declared
  in above headers.  include above headers if required.

  Note that rb_thread_mark() was declared as
  void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
  void rb_thread_mark(void *ptr) in vm.c.  Now it is declared as
  the later in internal.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17 22:43:38 +00:00
kosaki ecaf7975cd * eval.c: remove rb_thread_stop_timer_thread function declaration.
Instead, include vm_core.h.
* process.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-05 14:35:09 +00:00
kosaki bde7a62f91 * process.c (before_exec, after_exec): change from macro to function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-28 15:24:18 +00:00
kosaki ed02c4122a * process.c (before_exec, after_exec): change SIGPIPE handler to SIG_DFL
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
2011-05-28 13:52:03 +00:00
nagachika 537a293669 * process.c (rb_proc_times): improve documentation.
[ruby-core:35785] fixes #4581, reported by Andrew Grimm.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-14 08:47:02 +00:00
drbrain e2b3183fc2 * re.c (Init_Regexp): Document option constants. Patch by Vincent
Batts.  [Ruby 1.9 - Bug #4677]
	* lib/uri/common.rb (module URI):  Documentation for URI.  Patch by
	  Vincent Batts.  [Ruby 1.9- Bug #4677]
	* lib/uri/ftp.rb (module URI):  ditto
	* lib/uri/generic.rb (module URI):  ditto
	* lib/uri/http.rb (module URI):  ditto
	* lib/uri/https.rb (module URI):  ditto
	* lib/uri/ldap.rb (module URI):  ditto
	* lib/uri/ldaps.rb (module URI):  ditto
	* lib/uri/mailto.rb (module URI):  ditto
	* process.c (Init_process):  Document Process constants.  Patch by
	  Vincent Batts.  [Ruby 1.9- Bug #4677]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 20:39:11 +00:00
kosaki bd90dc80f2 * process.c (proc_getmaxgroups, proc_setmaxgroups): Process#maxgroups
and Process#maxgroups= now raise NotImplementedError if the
  platform don't support supplementary groups concept.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-10 16:54:02 +00:00
kosaki 4a8cf2d92d * process.c (get_sc_ngroups_max): return -1 if platform don't
support NGROUPS_MAX.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-10 16:26:01 +00:00
kosaki 776156243c * process.c (proc_setgroups): cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 14:52:05 +00:00
nobu 6917c26a7a * process.c (get_sc_ngroups_max): fix indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 14:40:03 +00:00
kosaki d558bb59c8 * process.c (get_sc_ngroups_max): try to use NGROUPS_MAX at first if
_SC_NGROUP_MAX is not defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 14:29:22 +00:00
nobu 15f0e53a06 * process.c (proc_setgroups): use getgrnam() if getgrnam_r() is
not available.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 00:25:40 +00:00
nobu 487185de67 * process.c: RARRAY_LEN() returns long int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08 00:08:16 +00:00
naruse c57118f757 * process.c (get_sc_ngroups_max): define to wrap sysconf(3).
this also supports Windows which doesn't have sysconf(3).

* process.c (maxgroups): use get_sc_ngroups_max.

* process.c (proc_setmaxgroups): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 16:44:36 +00:00
naruse fe8e2dd1e1 * process.c (maxgroups): cast because sysconf(3)'s return value is long.
* process.c (proc_setmaxgroups): ditto.

* process.c (proc_setgroups): cast because RARRAY_LEN() is long.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 16:13:57 +00:00
kosaki 52b40be04b small cleanup.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 12:54:27 +00:00
kosaki 19a127d0cb * process.c (proc_setgroups): replace getgrnam() with getgrnam_r()
because getgrnam() isn't thread safe.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 12:35:45 +00:00
kosaki 1a8ee910f3 * process.c (proc_getmaxgroups, proc_setmaxgroups): refrect
platform maxgroups limitation by default instead hardcoded 65536.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 11:58:12 +00:00
matz 1df42597d1 cancel subversion backfire. sorry
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 08:44:45 +00:00
matz eb807d42ec * gc.c (rb_gc_set_params): allow GC parameter configuration by
environment variables.  based on a patch from funny-falcon at
  https://gist.github.com/856296, but honors safe level.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 08:39:39 +00:00
nobu 7b3c2c28dc * process.c: NUM2RLIM is defined but no getrlimit and setrlimit on
mingw.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-07 00:06:08 +00:00
kosaki c6bb8beb52 * process.c (proc_getgroups): get rid of maxgroups dependency.
ngroups can be calculated dynamically.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-06 15:25:58 +00:00
kosaki b1329e3b63 * configure.in: rlim_t use standard RUBY_REPLACE_TYPE mechanism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-06 14:47:27 +00:00
kosaki beed971728 * process.c (proc_setmaxgroups): added negative value check.
This was suggested by Daniel Berger. Thanks Daniel!
  [ruby-core:35426][Bug#4467]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-06 14:28:02 +00:00
kosaki aca674c2e7 * process.c (maxgroups, proc_setmaxgroups): increase max groups
limitation up to 65536.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-06 14:21:31 +00:00
usa 4f8f4a9ee4 * process.c (check_exec_redirect_fd, check_exec_redirect): raise
ArgumentError if fd >= 3 on Windows because the feature is not
  supported.

* test/ruby/test_process.rb (test_execopts_redirect): remove meaningless
  argument.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-03 13:13:10 +00:00
kosaki 411e4a6cf2 * process.c (rb_run_exec_options_err): use MODET2NUM() instead LONG2NUM().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-08 07:01:23 +00:00
nagachika 012e60f61c * process.c (proc_setgroups): add GC guard to prevent intermediate
variable from GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-07 16:01:57 +00:00
kosaki 92c1dfd9d2 * configure.in: Added mode_t type checking.
* process.c (rb_exec_arg_addopt): Use NUM2MODET() instead
	  NUM2LONG because clang makes compile error by this narrowing
	  conversion.
	* process.c (rb_run_exec_options_err): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-28 02:00:08 +00:00
nobu fa57e46896 * process.c (ALLOC_ARGV_WITH_STR): fix void pointer arithmetic.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 03:46:44 +00:00
nobu beec203a1d * process.c (proc_exec_v, rb_proc_exec_n, rb_proc_exec)
(proc_spawn_n, proc_spawn): get rid of too huge alloca().
  [ruby-core:34827], [ruby-core:34833]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-26 23:41:47 +00:00
akr 89f9c4144f update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-29 01:33:28 +00:00
kosaki 5d276ea14a * process.c (before_exec): add small comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26 12:59:19 +00:00
akr a041f129af * process.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-23 23:46:39 +00:00
nobu 8f5689bf3c * process.c (p_uid_change_privilege, p_gid_change_privilege):
suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-05 22:33:14 +00:00
nobu 340c3b4638 * process.c (rb_fork_err): save errinfo before fdopen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-05 22:03:54 +00:00
nobu 1cf7194e0c * process.c (proc_spawn_v): should spawn, not exec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-05 03:18:03 +00:00
nobu d0553ffbb5 * process.c (proc_exec_v, proc_spawn_v): try to execute with sh if
no shebang.  [ruby-core:32745] [EXPERIMENTAL]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-04 16:21:38 +00:00
akr 3f0fd715f4 update document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-12 00:15:27 +00:00
akr d900ed31f7 * process.c (rlimit_resource_name2int): support more limits:
RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_RTPRIO, RLIMIT_RTTIME and
  RLIMIT_SIGPENDING.
  (Init_process): ditto.
  patch by Run Paint Run Run.  [ruby-core:32262]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-11 23:38:44 +00:00
akr b4ac655acc * process.c (rlimit_resource_name2int): use STRCASECMP to avoid
ALLOCA_N.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-11 19:28:07 +00:00
nobu aa5c05b8ba * ext/pty/pty.c (chfunc): pass through exceptions.
* io.c (rb_io_bufwrite, rb_io_bufread): added.

* process.c (rb_fork_err): protect from exceptions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-02 21:40:55 +00:00
naruse 7175a9073e * class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:
clean unused-value warnings.

* cont.c, process.c, vm_exec.h: clean cast warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27 07:13:43 +00:00
nobu afbd5661a0 * process.c (rb_daemon): split from proc_daemon.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13 12:31:17 +00:00