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

227 Коммитов

Автор SHA1 Сообщение Дата
kosaki 55b3bfbc4c * signal.c (reserved_signal_p): reverted a part of r32523.
chikanaga noticed trap(:CHLD) has some realworld usecase.
* test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
  ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 11:04:58 +00:00
kosaki 7fd8266516 small cleanup
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 05:12:29 +00:00
kosaki c307523565 * signal.c (install_sighandler): fixed a race.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 05:08:28 +00:00
kosaki 89e2951bde * signal.c (sig_trap): don't permit to change a signal handler which
the interpreter reserved.
* signal.c (reserved_signal_p): ditto.
  [Bug #2616] [ruby-core:27625]

* test/ruby/test_signal.rb (TestSignal#test_reserved_signal):
  added a test for reserved signal.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12 04:55:50 +00:00
kosaki 74b339e938 * thread_pthread.c (rb_thread_create_timer_thread): removed
rb_disable_interrupt()/rb_enable_interrupt().
* vm_core.h: ditto.
* process.c (static void before_exec): ditto.
* process.c (static void after_exec): ditto.
  [Bug #4765] [ruby-dev:43571]

* eval_intern.h: removed rb_trap_restore_mask().
* vm_eval.c (rb_throw_obj): ditto.
* eval.c (setup_exception): ditto.

* signal.c: removed trap_last_mask.
* signal.c (trap_restore_mask): removed.
* signal.c (init_sigchld): comment clarification why signal block
  is needed. and removed trap_last_mask operation.
* signal.c (trap_ensure): removed trap_last_mask operation.

* signal.c (rb_disable_interrupt, rb_enable_interrupt): made
  static and removed sigdelset(SIGVTALARM) and sigdelset(SIGSEGV).

* process.c (rb_syswait): removed implicit signal handler change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 17:04:40 +00:00
kosaki 2acd61551b * signal.c (sigsegv): use abort() instead of exit() when nested
SEGV was happen. Because unnested SEGV use abort().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-10 07:12:02 +00:00
kosaki 5a73c71dcf * thread_pthread.c (get_stack): add to a care of gurad page on Mac
OS X. [Bug #1813] [ruby-core:24540]
* signal.c (ruby_signal): SIGBUS use alternative stack too.
* signal.c (sigbus): On Mac, thread stack overflow makes SIGBUS
  instead of SIGSEGV. thus, added stackoverflow check.
* signal.c (default_handler): get rid of compilation warning.
* signal.c (Init_signal): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-02 19:59:05 +00:00
ko1 fa4514e4fe * thread.c (rb_threadptr_check_signal): only wake up main thread.
* thread.c (rb_threadptr_execute_interrupts_common): check signal
  deliverly if it is main thread.
  fixes [ruby-dev:44005] [Ruby 1.9 - Bug #4950]
* bootstraptest/test_fork.rb: add a test for above.
* signal.c (rb_get_next_signal): skip if signal_buff is empty.
  (check signal_buff.size first)
* vm_core.h: remove unused variable rb_thread_t::exec_signal.
* thread.c (rb_thread_check_trap_pending): check
  rb_signal_buff_size() because rb_thread_t::exec_signal
  is no longer available.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30 22:29:34 +00:00
kosaki 0148d41a13 * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.
The code have already depended on pthread_sigmask since r27464.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-28 10:42:25 +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
sorah e6f4c92f6d * signal.c(ruby_atomic_exchange): Fix definement style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-23 04:33:13 +00:00
kosaki 9d4e471cf9 * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,
RUBY_VM_SET_FINALIZER_INTERRUPT): use atomic ops for preventing
  interrupt_flag bit lost.
* thread.c (rb_threadptr_execute_interrupts_rec): ditto.
* vm_core.h (typedef struct rb_thread_struct): change type of
  interrupt_flag to rb_atomic_t.
* atomic.h: move atomic ops definition from signal.c.
* signal.c: remove atomic ops definition.
* common.mk (gc, signal, thread, cont): add to dependency to atomic.h.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 14:27:08 +00:00
kosaki e39b50d4b5 * signal.c (Init_signal, default_handler): change default SIGPIPE handler
from empty function to SIG_IGN. [ruby-dev:43215]
* signal.c (sigpipe): removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-28 07:11:54 +00:00
nagachika 29c2876d61 * signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol or
implicit convertion with #to_str. [ruby-dev:43169] fixes #4362
* test/ruby/test_signal.rb (test_signal_process_group): add a test
  for send signal to process group.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 13:37:47 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
kosaki df52785d30 * signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
because FreeBSD don't permit it. If it's used, it behave as
  pthread_sigmask(xx, NULL, &mask).

* signal.c (init_sigchld): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-19 18:14:30 +00:00
akr fc38c70ce9 * signal.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-29 01:07:26 +00:00
kosaki 47a1cd1291 * signal.c: change rb_atomic_t definition from uchar to uint.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 06:28:05 +00:00
nobu a5eb40b999 * signal.c (ruby_signal): fix condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11 12:30:35 +00:00
nobu 7b410abfb8 * configure.in (rb_cv_gcc_atomic_builtins): check for atomic
builtins, all are not available in Apple derivative gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26 00:13:37 +00:00
nobu 3ea90fc38e * signal.c: fix typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-25 23:46:27 +00:00
shyouhei 2c770d676c * signal.c (rb_atomic_t): GCC (of at least recent versions)
has  ubiquitos  support  for  atomic  operations.   On  that
  compiler a C  program can isse a memory  barrier using these
  dedicated  instructions.  According to  the GCC  manual they
  cargo culted  this feature form  the Itanium ABI  so chances
  are that  other compilers  could also support  this feature.
  But so far GCC is the  only compiler that I know to have it.
  Also note that this works on non-Itanium machines.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-25 07:46:53 +00:00
nobu 8022385ba4 * debug.c (ruby_set_debug_option): define always for binary
compatibility with debug env enabled binary.

* signal.c (ruby_enable_coredump): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13 02:04:10 +00:00
marcandre 7729de4d91 * array.c: Documentation: change => in call-seq to ->.
Harmonize "#=>" in examples. [ruby-core:30206]

* bignum.c: ditto

* class.c: ditto

* compar.c: ditto

* cont.c: ditto

* dir.c: ditto

* encoding.c: ditto

* enum.c: ditto

* enumerator.c: ditto

* error.c: ditto

* eval.c: ditto

* file.c: ditto

* gc.c: ditto

* io.c: ditto

* load.c: ditto

* marshal.c: ditto

* math.c: ditto

* numeric.c: ditto

* object.c: ditto

* pack.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* range.c: ditto

* re.c: ditto

* ruby.c: ditto

* signal.c: ditto

* sprintf.c: ditto

* string.c: ditto

* struct.c: ditto

* thread.c: ditto

* time.c: ditto

* transcode.c: ditto

* variable.c: ditto

* vm_eval.c: ditto

* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:07:33 +00:00
mame 50587316b8 * vm_core.c (rb_thread_struct): add a field for sigaltstack.
* thread_pthread.c (thread_start_func_1): initialize machine stack
  information.

* thread.c (thread_start_func_2): set sigaltstack for each sub thread.
  [ruby-core:24540] [ruby-core:30207]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 16:20:26 +00:00
marcandre 4d3f877180 * signal.c (ruby_signal_name): rdoc fix for undocumented parameter
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 04:35:16 +00:00
marcandre 478c3e080b * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrong
number of arguments

* file.c (rb_f_test, rb_file_s_umask): ditto

* numeric.c (int_chr, num_step): ditto

* process.c (rb_f_sleep): ditto

* re.c (rb_reg_initialize_m): ditto

* signal.c (rb_f_kill, sig_trap): ditto

* string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang,
  rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto

* proc.c (curry): rdoc fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30 02:40:57 +00:00
mame 8687db60a6 * process.c (rb_f_fork): remove after_exec() which sometimes caused
two timer threads started.  [ruby-core:25217]

* signal.c: use pthread_sigmask() instead of sigprocmask().
  sigprocmask() is unspecified behavior on multi-thread programs.
  [ruby-core:25217]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-23 15:44:19 +00:00
naruse c0eb5bb6f2 * signal.c (USE_SIGALTSTACK): NetBSD can't use sigaltstack(2)
with pthread.
  http://netbsd.gw.com/cgi-bin/man-cgi?sigaltstack++NetBSD-current

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-15 08:49:51 +00:00
nobu 423657b42c * signal.c (USE_SIGALTSTACK): only when SA_SIGINFO also is
available.  see [ruby-core:27768].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25 03:11:46 +00:00
naruse d5b0c4b1f3 * dln.c, file.c, io.c, signal.c: add __HAIKU__.
patched by Alexander von Gluck [ruby-core:27767]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25 03:06:06 +00:00
akr ff9d908832 * include/ruby/ruby.h (rb_bug_errno): declared.
* include/ruby/intern.h (rb_strerrno): declaration removed.

* error.c (rb_strerrno): make it static.  return NULL for unknown
  errors.
  (rb_bug_errno): defined.

* thread_pthread.c: use rb_bug_errno.

* signal.c (ruby_signal): use rb_bug_errno.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-24 11:03:51 +00:00
akr b9e0294eda fix typos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:46:28 +00:00
nobu 04d1998ff8 * signal.c (interrupt_init): nodoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13 10:34:35 +00:00
nobu 6b60792135 * signal.c (rb_f_kill): added rdoc about exceptions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13 09:51:04 +00:00
ko1 79b62da9b4 * thread.c: rename functions which require a parameter
"rb_thread_t *", the prefix to be rb_threadptr_ instead of
  rb_thread_.
* thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook):
  change the parameter type from rb_thread_t * to VALUE.
* eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c:
  ditto.
* include/ruby/intern.h: remove decl of rb_thread_signal_raise() and
  rb_thread_signal_exit().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-08 16:14:06 +00:00
nobu cb434b4a80 * signal.c (sig_trap): suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10 19:22:11 +00:00
nobu 6bdeed2b47 * signal.c (rb_disable_interrupt, rb_enable_interrupt): see
USE_TRAP_MASK.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24 02:21:53 +00:00
nobu 12d2c8ba41 stripped trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 14:23:33 +00:00
akr 4e2141622f * signal.c (register_sigaltstack): ignore sigaltstack error.
It fails on OpenBSD 4.4 when pthread library is linked.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06 11:40:33 +00:00
nobu 845103b751 * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),
eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c
  (uscore_get, rb_f_chop), st.c (stat_col), signal.c
  (rb_signal_buff_size, ruby_sig_finalize), thread.c
  (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone):
  protoized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-01 12:51:44 +00:00
nobu 9e22c8390c * signal.c (trap_handler): also accepts symbols. [ruby-dev:37823]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-23 04:25:29 +00:00
matz c6af6b1b94 * symbian/README.SYMBIAN: symbian support added. great appreciate
to <alexandre.zavorine at symbian.com>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 01:53:08 +00:00
naruse d4b3e8ae70 * signal.c (rb_signal_buff_size): defined for check whether signal
is in the buffer or not.

* thread_pthread.c (thread_timer): don't exit the loop when signal
  is in the buffer. [ruby-dev:37637]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 21:50:01 +00:00
matz 782576a519 * ext/curses/curses.c (window_getch): avoid ISPRINT() macro which
has an issue with OpenSolaris.  [ruby-core:20189]

* signal.c (ruby_signal): EINVAL from sigaction(2) is not a bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 04:57:58 +00:00
usa 13a79948fe * signal.c (register_sigaltstack): no need to define on non-sigaltstack
platform.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-01 06:49:34 +00:00
nobu ab9fd5dbf7 * signal.c (register_sigaltstack): stores alt stack for debug
purpose.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 07:32:56 +00:00
nobu 550f10ca5b * signal.c (ruby_sigaction_t): added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 07:12:35 +00:00
nobu 079505c040 * signal.c (ALT_STACK_SIZE): default minimum size is insufficient
for method calls.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 06:59:19 +00:00
nobu 7348aa6113 * gc.c (ruby_stack_check): no check if using sigaltstack.
* signal.c (register_sigaltstack): minimum size is insufficient for
  method calls.

* signal.c (sigsegv): handles stack overflow if possible.

* thread.c (ruby_thread_stack_overflow): helper function to raise
  sysstack_error.

* thread_pthread.c (ruby_stack_overflowed_p): checks for stack
  overflow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-27 06:05:07 +00:00
matz 3380a05bd6 * signal.c (register_sigaltstack): should not add external
variable (with some cosmetic changes).  [ruby-dev:37158]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-24 14:25:45 +00:00
yugui 0abd67ea19 * signal.c (default_handler, Init_signal): compile error if
USE_SIGALTSTACK is not defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-23 07:07:34 +00:00
yugui 7c9a77f880 * signal.c (ALT_STACK_SIZE): 4KB is not enough on Mac OS X.
Uses SIGSTKSZ.  this fixes [ruby-core:20040].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-23 04:17:52 +00:00
matz 68a75f19e9 * signal.c (register_sigaltstack): use alternative stack for
SIGSEGV to avoid uncaught stack overflow. based on a patch from
  Hiro Yoshioka <hyoshiok at miraclelinux.com> in [ruby-dev:37134].
  [ruby-dev:36993]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-21 18:27:33 +00:00
nobu 5c3fe0e339 * signal.c (signal_buff): made static. a patch by Tadashi Saito
<shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36915]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-24 18:58:52 +00:00
yugui 642e081879 * dln.c: Ruby no longer supports MacOS 9 or before.
* eval.c: ditto.

* eval_intern.h: ditto.

* ext/extmk.rb: ditto.

* ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.

* ext/tk/stubs.c: ditto.

* file.c: ditto.

* hash.c: ditto.

* include/ruby/defines.h: ditto.

* ruby.c: ditto.

* signal.c: ditto.

* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:42:00 +00:00
yugui 8dd118c0db * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
* djgpp/README.djgpp: ditto.

* djgpp/config.hin: ditto.

* djgpp/config.sed: ditto.

* djgpp/configure.bat: ditto.

* djgpp/mkver.sed: ditto.

* ext/Setup.dj: ditto.

* dln.c: removed djgpp supports.

* file.c: ditto.

* gc.c: ditto.

* io.c: ditto.

* process.c: ditto.

* ruby.c: ditto.

* signal.c: ditto.

* util.c: ditto.

* vm_core.h: ditto.

* lib/fileutils.rb: ditto.

* lib/mkmf.rb: ditto.

* ext/socket/socket.c: ditto.

* test/fileutils/test_fileutils.rb: ditto.

* test/ruby/test_env.rb: ditto.

* test/ruby/test_path.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:25:12 +00:00
ko1 2e311f6bd5 * include/ruby/node.h, node.h: move node.h from include path.
This change stop to install node.h beacuase of saving ABI
  (node.h will be changed. Extensions should not depends on
  this file).
* blockinlining.c, class.c, compile.c, debug.h, enum.c,
  gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c,
  vm.c, vm_core.h, vm_dump.c: ditto.
* ext/ripper/depend: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 19:52:31 +00:00
ko1 29f5911cf5 * signal.c (signal_exec): execute rb_eval_cmd() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 19:09:11 +00:00
ko1 445e26fb00 * signal.c (signal_exec): fix to use rb_proc_call().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 11:37:23 +00:00
nobu c5bf9ceef6 * vm_core.h (struct rb_vm_struct): replaced signal staff with trap
staff.

* signal.c (signal_buff): per process resouce now.

* signal.c (trap_list): moved to VM.

* signal.c (rb_get_next_signal): reverted.

* signal.c (rb_trap_exit): trap_pending_list was no longer used.

* thread.c (timer_thread_function): delivers buffered per-process
  signals to each VMs.

* vm.c (rb_vm_mark): marks trap_list.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:22:04 +00:00
ko1 204929af9d * include/ruby/signal.h: removed.
* common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c,
  io.c, process.c, signal.c: vm_core.h: ditto.
  Some unused external global variables are also removed.
  (rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending,
  rb_thread_critical)
* ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c,
  ext/readline/readline.c, ext/socket/depend,
  ext/socket/socket.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 08:00:05 +00:00
nobu 1b2af065a2 * signal.c (signal_exec, trap_handler): trap accepts a string as
command.  [ruby-dev:35533]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-16 09:04:37 +00:00
nobu 4641b80166 * gc.c (ruby_gc_stress): moved to rb_objspace_t.
* gc.c (gc_stress_get, gc_stress_set): VM local attribute.

* signal.c (sigsegv): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13 15:09:22 +00:00
akr aaa90dddfb update Signal.list rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10 23:23:36 +00:00
mame bd9030438e * signal.c (esignal_signo): fix SignalException#signo which returned
nil absolutely.

* signal.c (esignal_init): always prepend "SIG" to a string that is
  returned by SignalException#signm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-30 13:32:39 +00:00
mame 9df121034a * signal.c (esignal_init): handle a non-integer argument correctly,
allowing SignalException.new(:INT).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-29 17:08:48 +00:00
nobu 87e4ad0a23 * io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
suppress warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 09:36:35 +00:00
nobu e615e3ce30 * error.c (builtin_types), signal.c (siglist), st.c (primes),
struct.c (ref_func), time.c (months): constified.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 08:30:22 +00:00
usa c4693e62af * signal.c: sorry, commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-26 06:10:45 +00:00
usa 116b15765d * 2008-02-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-26 00:09:17 +00:00
nobu 82f631ac57 * configure.in (sigsetmask): check when signal semantics is not POSIX.
* signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is
  available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 17:40:56 +00:00
akr 6cdef2dc7e * $Date$ keyword removed to avoid inclusion of locale dependent
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
ko1 314bef7ef1 * insnhelper.ci, vm.c, vm_core.h: change interface of
vm_invoke_block() to specify block ptr.  [ruby-talk:266422]
* cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c:
  apply above change.
* bootstraptest/test_knownbug.rb: move fixed bug.
* bootstraptest/test_block.rb: ditto. and add a test.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 07:07:35 +00:00
akr 1dd06c4301 * signal.c (posix_signal): return value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-08 09:01:43 +00:00
matz da42035b09 * signal.c (ruby_signal): use SA_SIGINFO if available.
[ ruby-Patches-6418 ]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-30 14:49:45 +00:00
matz 29c7c72e09 * signal.c (trap_signm): SIGVTALRM no longer used for green
thread.  [ruby-talk:281318]

* signal.c (ruby_sig_finalize): do not install SIG_DFL handler if
  previous handler is sighandler().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-30 14:08:58 +00:00
matz 07d12a2a5f * vm_core.h (rb_vm_struct): fix typo: bufferd -> buffered.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28 07:25:51 +00:00
matz a25fbe3b3e * encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.

* parse.y (pragma_encoding): encoding specification pragma.

* parse.y (rb_intern3): encoding specified symbols.

* string.c (rb_str_length): length based on characters.  
  for older behavior, bytesize method added.

* string.c (rb_str_index_m): index based on characters.  rindex as
  well.

* string.c (succ_char): encoding aware succeeding string.

* string.c (rb_str_reverse): reverse based on characters.

* string.c (rb_str_inspect): encoding aware string description.

* string.c (rb_str_upcase_bang): encoding aware case conversion.
  downcase, capitalize, swapcase as well.

* string.c (rb_str_tr_bang): tr based on characters.  delete,
  squeeze, tr_s, count as well.

* string.c (rb_str_split_m): split based on characters.

* string.c (rb_str_each_line): encoding aware each_line.

* string.c (rb_str_each_char): added.  iteration based on
  characters.

* string.c (rb_str_strip_bang): encoding aware whitespace
  stripping.  lstrip, rstrip as well.

* string.c (rb_str_justify): encoding aware justifying (ljust,
  rjust, center).

* string.c (str_encoding): get encoding attribute from a string. 

* re.c (rb_reg_initialize): encoding aware regular expression

* sprintf.c (rb_str_format): formatting (i.e. length count) based
  on characters.

* io.c (rb_io_getc): getc to return one-character string.
  for older behavior, getbyte method added.

* ext/stringio/stringio.c (strio_getc): ditto.

* io.c (rb_io_ungetc): allow pushing arbitrary string at the
  current reading point.

* ext/stringio/stringio.c (strio_ungetc): ditto.

* ext/strscan/strscan.c: encoding support.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 03:29:39 +00:00
ko1 6b6bf4dd48 * blockinlining.c: remove "yarv" prefix.
* array.c, numeric.c: ditto.
* insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
* yarvcore.c: removed.
* yarvcore.h: renamed to core.h.
* cont.c, debug.c, error.c, process.c, signal.c : ditto.
* ext/probeprofiler/probeprofiler.c: ditto.
* id.c, id.h: added.
* inits.c: ditto.
* compile.c: rename internal functions.
* compile.h: fix debug flag.
* eval.c, object.c, vm.c: remove ruby_top_self.
  use rb_vm_top_self() instead.
* eval_intern.h, eval_load: ditto.
* gc.c: rename yarv_machine_stack_mark() to
  rb_gc_mark_machine_stack().
* insnhelper.h: remove unused macros.
* iseq.c: add iseq_compile() to create iseq object
  from source string.
* proc.c: rename a internal function.
* template/insns.inc.tmpl: remove YARV prefix.
* thread.c:
* vm.c (rb_iseq_eval): added.
* vm.c: move some functions from yarvcore.c.
* vm_dump.c: fix to remove compiler warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12 04:25:46 +00:00
nobu eae8a9143f * debug.c (ruby_set_debug_option): separated from main.c.
* gc.c (ruby_gc_stress), signal.c (ruby_enable_coredump): prefixed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-29 07:57:24 +00:00
akr 9f46c2ba2e refine previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-29 03:08:19 +00:00
akr dea470cca4 debug environment variable refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-28 14:22:30 +00:00
ko1 97ba019c94 * vm.c: some refactoring.
* rename th_* to vm_*.
  * remove unused variables functions.
  * add prototypes.
* blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h,
  eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y,
  proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c,
  vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 15:42:41 +00:00
ko1 4471bf2356 * signal.c (sigsegv): clear gc_stress flag on SEGV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-17 17:46:25 +00:00
akr 8092d0bd87 fix trap's doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15 14:33:59 +00:00
akr 787f96eb97 * signal.c (default_handler): func argument removed.
(trap_handler): support SYSTEM_DEFAULT.  call default_handler
  internally.
  (sig_trap): don't call default_handler.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15 13:38:32 +00:00
akr cebc9bb19d * signal.c (trap_handler): trap("SIGSEGV", "DEFAULT") may cause wrong
trap error because SIG_DFL may be zero.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15 09:58:10 +00:00
akr e3dd9a78db re-introduce RUBY_GC_STRESS test removed by YARV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15 08:38:58 +00:00
nobu 2b592580bf * include/ruby: moved public headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10 03:06:15 +00:00
nobu 06eeec8a40 * signal.c (interrupt_init): needs to pass nil for Interrupt.
[ruby-core:11038]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 17:13:05 +00:00
nobu 290569b06c * signal.c (trap): fixed segfaults. [ruby-dev:30830]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 17:08:37 +00:00
nobu 3fc37d71c4 * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]
* eval_error.h (error_handle): no message when exiting by signal.

* intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.

* signal.c (esignal_init): takes a signal number and an optional
  signal name.

* signal.c (interrupt_init): pass SIGINT always.

* signal.c (ruby_default_signal): invoke system default signal
  handler.

* signal.c (rb_f_kill): use NUM2PIDT instead of NUM2INT.

* signal.c (rb_signal_exec, trap): handle SIGTERM.  [ruby-dev:30505]

* thread.c (rb_thread_signal_raise): now takes signal number instead
  of signal name.

* thread.c (rb_thread_signal_exit): since rb_make_exception() calls
  #exception method, rb_class_new_instance() is not needed here.

* yarvcore.h (struct rb_vm_struct), eval_jump.h (terminate_process):
  exit_code is no longer stored in VM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-19 17:37:03 +00:00
ko1 757ed3ccf1 * ruby.h: define RUBY_VM macro and remove NATIVETHREAD* macros.
* intern.h: ditto.
* signal.c (posix_signal): remove unused function
  posix_nativethread_signal().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-25 02:43:43 +00:00
usa 3207cd3897 * signal.c (sighandler): need to re-install sighandler on some
platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 06:59:12 +00:00
ko1 9c574383a4 * blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
  thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
  vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fix typo (rb_thead_t -> rb_thread_t).

* eval_intern.h: remove unused definitions.

* common.mk: fix around vm_opts.h path
  and remove harmful argument passed to insns2vm.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-08 06:37:46 +00:00
ko1 8ee7d0767f * blockinlining.c, compile.c, compile.h, error.c, eval.c,
eval_intern.h, eval_jump.h, eval_load.c, eval_method.h,
  eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c,
  process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def,
  yarv.h, yarvcore.h, yarvcore.c: change type and macro names:
  * yarv_*_t -> rb_*_t
  * yarv_*_struct -> rb_*_struct
  * yarv_tag -> rb_vm_tag
  * YARV_* -> RUBY_VM_*
* proc.c, vm.c: move functions about env object creation
  from proc.c to vm.c.
* proc.c, yarvcore.c: fix rb_cVM initialization place.
* inits.c: change Init_ISeq() order (after Init_VM).
* ruby.h, proc.c: change declaration place of rb_cEnv
  from proc.c to ruby.c.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06 19:00:03 +00:00
nobu 205f310c29 * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c,
  insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y,
  range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci,
  vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fixed indents and non-C90 comments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 16:26:04 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
matz 65aa6b9a51 * signal.c (Init_signal): avoid duplicated installation of SIGCHLD
handler.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-22 08:07:12 +00:00