summaryrefslogtreecommitdiff
path: root/signal.c
AgeCommit message (Collapse)Author
2012-05-17Imports Ruby's port to NativeClient (a.k.a NaCl).yugui
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
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23* signal.c (sig_trap): show signal name on error.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* bignum.c (big_rshift), compile.c (validate_label,nobu
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* signal.c (reserved_signal_p): static.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-13* atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.nobu
[ruby-dev:44596] [Bug #5439] * signal.c (ruby_atomic_exchange): no needs to define on the platforms where atomic.h is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-30* vm.c (th_init): preallocate alternative stack.kosaki
NoMemoryError is better than rb_bug, of course. Patch by Eric Wong. [ruby-core:38572][ruby-core:38594]. * signal.c (rb_register_sigaltstack): ditto. * vm_core.h: moved ALT_STACK_SIZE definition from signal.c. * vm.c (thread_free): use xfree() instead of free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12* signal.c (reserved_signal_p): reverted a part of r32523.kosaki
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-12small cleanupkosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12* signal.c (install_sighandler): fixed a race.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-12* signal.c (sig_trap): don't permit to change a signal handler whichkosaki
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-10* thread_pthread.c (rb_thread_create_timer_thread): removedkosaki
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* signal.c (sigsegv): use abort() instead of exit() when nestedkosaki
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-02* thread_pthread.c (get_stack): add to a care of gurad page on Mackosaki
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-06-30* thread.c (rb_threadptr_check_signal): only wake up main thread.ko1
* 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-28* signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.kosaki
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-27* thread_pthread.c: Stop polling in the timer thread when there areko1
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-23* signal.c(ruby_atomic_exchange): Fix definement style.sorah
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11* vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,kosaki
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-05-28* signal.c (Init_signal, default_handler): change default SIGPIPE handlerkosaki
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-15* signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol ornagachika
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* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-19* signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usagekosaki
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
2010-12-29* signal.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * signal.c: change rb_atomic_t definition from uchar to uint.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-11* signal.c (ruby_signal): fix condition.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-26* configure.in (rb_cv_gcc_atomic_builtins): check for atomicnobu
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-25* signal.c: fix typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-25* signal.c (rb_atomic_t): GCC (of at least recent versions)shyouhei
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-13* debug.c (ruby_set_debug_option): define always for binarynobu
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-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
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-13* vm_core.c (rb_thread_struct): add a field for sigaltstack.mame
* 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-04-30* signal.c (ruby_signal_name): rdoc fix for undocumented parametermarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30* eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre
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-23* process.c (rb_f_fork): remove after_exec() which sometimes causedmame
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-02-15* signal.c (USE_SIGALTSTACK): NetBSD can't use sigaltstack(2)naruse
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-01-25* signal.c (USE_SIGALTSTACK): only when SA_SIGINFO also isnobu
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* dln.c, file.c, io.c, signal.c: add __HAIKU__.naruse
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
2009-11-24* include/ruby/ruby.h (rb_bug_errno): declared.akr
* 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-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13* signal.c (interrupt_init): nodoc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13* signal.c (rb_f_kill): added rdoc about exceptions.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-08* thread.c: rename functions which require a parameterko1
"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-03-10* signal.c (sig_trap): suppress warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* signal.c (rb_disable_interrupt, rb_enable_interrupt): seenobu
USE_TRAP_MASK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-06* signal.c (register_sigaltstack): ignore sigaltstack error.akr
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-01* cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),nobu
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-01-23* signal.c (trap_handler): also accepts symbols. [ruby-dev:37823]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15* symbian/README.SYMBIAN: symbian support added. great appreciatematz
to <alexandre.zavorine at symbian.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e