summaryrefslogtreecommitdiffstats
path: root/process.c
Commit message (Collapse)AuthorAgeFilesLines
* * process.c (after_fork): ignores a termination request in thenobu2008-12-261-1/+1
| | | | | | | parent process. [ruby-dev:37447] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork): don't propagete an error message if errorakr2008-12-231-2/+4
| | | | | | | buffer not given. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork): propagete an error message from child to parent.akr2008-12-231-53/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_f_exec): show details of error in child process on exception. (save_redirect_fd): add error message arguments. (run_exec_dup2): ditto. (run_exec_close): ditto. (run_exec_open): ditto. (run_exec_dup2_child): ditto. (run_exec_pgroup): ditto. (run_exec_rlimit): ditto. (rb_run_exec_options): ditto. (rb_exec): ditto. (rb_exec_atfork): ditto. (rb_spawn_internal): ditto. (rb_spawn): ditto. (rb_f_system): follow arguments change. (proc_daemon): ditto. (rb_f_spawn): show details of error in child process on exception. * io.c (popen_exec): add error message arguments. (pipe_open): show details of error in child process on exception. * include/ruby/intern.h (rb_run_exec_options): add error message arguments. (rb_exec): ditto. (rb_fork): ditto. (rb_spawn): ditto. * ext/pty/pty.c (chfunc): add error message arguments. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (forked_child): new variable.akr2008-12-131-2/+5
| | | | | | | | | | | | | | | | (before_exec): don't call rb_thread_stop_timer_thread if forked_child. (after_exec): reset forked_child after rb_thread_start_timer_thread. (rb_fork): set forked_child just after fork in child. * ext/pty/pty.c (chfunc): extracted from establishShell. (establishShell): use rb_fork. [ruby-dev:37418] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-061-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc udpate.akr2008-12-051-20/+37
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-051-27/+37
| | | | | | | | prefer :in over STDIN because STDIN.fileno may changed if STDIN.instance_eval { initialize 1 }. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (run_exec_dup2): !save is false if Qnil.akr2008-12-051-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (run_exec_dup2): need to sort by reverted order whenusa2008-12-041-1/+14
| | | | | | | | restoring fds. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-041-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.akr2008-12-041-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2008-12-041-29/+50
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (check_exec_fds): resolve cascaded child fd reference.akr2008-12-041-9/+29
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (EXEC_OPTION_DUP2_CHILD): defined.akr2008-12-031-19/+125
| | | | | | | | | | | | (check_exec_redirect_fd): check :in, :out and :err. (check_exec_redirect): check [:child, fd]. (check_exec_fds): validate EXEC_OPTION_DUP2_CHILD array. (run_exec_dup2_child): new function. (rb_run_exec_options): call run_exec_dup2_child. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (check_exec_redirect): accept :in, :out, :err as redirectakr2008-12-031-0/+12
| | | | | | | target. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_fork): stops the timer thread during fork.nobu2008-11-241-4/+6
| | | | | | | | | | [ruby-dev:37117] * thread.c (rb_thread_start_timer_thread): timer thread needs system_working to be set. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (run_exec_dup2): fix resource leak.mame2008-10-091-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_run_exec_options): fix resource leak.mame2008-10-091-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports VMS.yugui2008-10-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * error.c: ditto. * eval.c: ditto. * eval_intern.h: ditto. * include/ruby/defines.h: ditto. * include/ruby/ruby.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * vms/config.h: removed. * vms/vms.h: ditto. * vms/vmsruby_private.c: ditto. * vms/vmsruby_private.h: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports MS-DOS.yugui2008-10-041-19/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/sdbm/_sdbm.c: ditto. * ext/sdbm/sdbm.h: ditto. * gc.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * include/ruby/util.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * strftime.c: ditto. * util.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.yugui2008-10-041-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * x68/_dtos18.c: removed. Ruby no longer supports human68k.yugui2008-10-041-31/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * x68/_round.c: ditto. * x68/fconvert.c: ditto. * x68/select.c: ditto. * ext/Setup.x68: ditto. * missing/x68.c: ditto. * dln.c (dln_find_exe_r): removed human68k supports. (dln_find_1): ditto. * lib/mkmf.rb: ditto. * ext/extmk.rb (Init_ext): ditto. * ext/socket/socket.c (init_sock): ditto. * gc.c (GC_MALLOC_LIMIT): ditto. (rb_setjmp, rb_jmpbuf): ditto. (mark_current_machine_context): ditto. * include/ruby/defines.h (PATH_ENV): ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_path.rb: ditto. * LEGAL git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (check_exec_redirect): don't depend on rb_stdout andakr2008-09-301-2/+3
| | | | | | | rb_stderr. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * win32/win32.c (getppid): typo. [ruby-dev:36202]usa2008-09-081-2/+2
| | | | | | | | * process.c (get_ppid): mention the return value on Windows. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz2008-09-051-4/+4
| | | | | | | a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_modestr_fmode): renamed fromakr2008-09-051-1/+1
| | | | | | | | | | | | | | | | | | rb_io_mode_flags. (rb_io_modestr_oflags): renamed from rb_io_mode_modenum. (rb_io_oflags_fmode): renamed from rb_io_modenum_flags. (rb_io_mode_flags): defined as a macro. (rb_io_modenum_flags): ditto. * io.c: follow the renaming with consistency. * process.c (check_exec_redirect): call rb_io_modestr_oflags. * ext/pty/depend: pty.o depends on io.h. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/signal.h: removed.ko12008-09-031-3/+1
| | | | | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: rename RB_UBF_DFL toko12008-08-311-2/+2
| | | | | | | | | | RUBY_UBF_IO and RUBY_UBF_PROCESS. Because there is no default (universal) unblocking function. * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (pst_pid): use rb_attr_get to avoid warning onakr2008-08-211-3/+7
| | | | | | | | Process::Status.allocate.pid. (pst_inspect): don't raise if self is not initialized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (dump_ensure), process.c (run_exec_dup2),nobu2008-08-041-3/+3
| | | | | | | | | string.c (rb_str_replace), transcode.c (transcode_dispatch): fixed memory leaks. based on patches from shinichiro.h <shinichiro.hamaji AT gmail.com> at [ruby-dev:35751]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (pst_message): removed no longer used variable.nobu2008-07-221-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu2008-07-221-10/+6
| | | | | | | | | | | | | | iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm), process.c (pst_message), re.c (match_inspect): use rb_str_catf. * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use rb_sprintf. * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use rb_vsprintf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (rb_thread_t), vm.c (rb_thread_mark), process.cnobu2008-07-101-7/+6
| | | | | | | | | | (rb_last_status_get, rb_last_status_set, rb_last_status_clear): moved last_status from rb_vm_t. [ruby-dev:35414] * vm.c (th_init2): initialize last_status with nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename rb_pipe_internal to rb_pipe.akr2008-07-051-1/+1
| | | | | | | use rb_pipe in pipe_nocrash. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update spawn rdoc a bit.akr2008-07-051-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (run_exec_rlimit): ISO C90 forbids mixed declarationsshyouhei2008-07-011-4/+5
| | | | | | | and code git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (enum ruby_special_consts): ISO C forbidsshyouhei2008-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | comma at end of enumerator list * include/ruby/ruby.h (enum ruby_value_type): ditto. * eval_intern.h (enum): ditto. * vm_core.h (enum rb_thread_status): ditto. * parse.y (enum lex_state_e): ditto. * parse.y (enum string_type): ditto. * process.c (enum): ditto. * ruby.c (enum dump_flag_bits): ditto. * ruby.c (enum disable_flag_bits): ditto. * compile.c (iseq_link_element): ditto * debug.c (union): ditto. * cont.c (enum context_type): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (Init_process): fix to avoid a warning.ko12008-06-291-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: need a ",".ko12008-06-261-1/+1
| | | | | | | | * process.c (rb_fork): check CANNOT_FORK_WITH_PTHREAD macro. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/win32.h, win32/win32.c (rb_w32_getppid): now supportusa2008-06-241-4/+0
| | | | | | | | | | getppid() on win32 (but only Win2k or later). * process.c (get_ppid): remove win32 special logic. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (Init_process): Process::Status#to_int removed.akr2008-06-201-14/+14
| | | | | | | | | | | | | | | | | | | | | (PST2INT): defined. (pst_to_s): use PST2INT. (pst_inspect): ditto. (pst_equal): ditto. (pst_bitand): ditto. (pst_rshift): ditto. (pst_wifstopped): ditto. (pst_wstopsig): ditto. (pst_wifsignaled): ditto. (pst_wtermsig): ditto. (pst_wifexited): ditto. (pst_wexitstatus): ditto. (pst_success_p): ditto. (pst_wcoredump): ditto. (rb_f_system): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_detach_process): store detached process ID in thenobu2008-06-201-1/+18
| | | | | | | thread local storage. moved from lib/open3.rb. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_f_fork): NetBSD 4.0 or later can fork.usa2008-06-191-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (run_exec_pgroup): C99 ism.usa2008-06-031-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_spawn_internal): set last_status when status == -1usa2008-05-191-0/+4
| | | | | | | | | | because there is no path to set it on win32. this patch is derived from [ruby-core:16787], submitted by Luis Lavena <luislavena at gmail.com> git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c, include/ruby/intern.h (rb_run_exec_options): externed.usa2008-05-121-18/+112
| | | | | | | | | | | | | | | | | | | | | | * process.c (save_redirect_fd, save_env_i, save_env, run_exec_dup2, run_exec_open, run_exec_pgroup, run_exec_rlimit, rb_run_exec_options): save parent's process environments. !!!remark!!! these are not thread-safe. * process.c (rb_spawn_internal): remove calling run_exec_options() because cannot restore after spawn. we'll fix this later. * io.c (pipe_open): ditto. * test/ruby/test_process.rb (test_execopts_env): upcase environment variable name for case insensitive platforms. * win32/win32.c (init_env): set USER environment variable only when USERNAME is available. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_spawn_internal): remove calling run_exec_options()usa2008-05-121-0/+2
| | | | | | | | because cannot restore after spawn. we'll fix this later. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_spawn_internal): need to call run_exec_options() beforeusa2008-05-121-8/+11
| | | | | | | | spawn if the platform doesn't have fork. [ruby-dev:34647] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_cleanup_func_before_exec): extracted fromakr2008-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | thread_cleanup_func not to touch pthread data. pthread_cond_destroy in forked process may cause deadlock on Debian GNU/Linux Etch on x86, x86-64 and IA64. this doesn't cause resource leak because the process will exec soon. (terminate_atfork_before_exec_i): defined. (rb_thread_atfork_before_exec): defined. * include/ruby/intern.h (rb_thread_atfork_before_exec): declared. * process.c (rb_exec_atfork): call rb_thread_atfork_before_exec instead of rb_thread_atfork. * io.c (popen_exec): call rb_thread_atfork_before_exec instead of rb_thread_atfork. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c (dln_find_exe_r, dln_find_file_r): reentrant versions.nobu2008-05-071-7/+18
| | | | | | | | | * file.c (rb_find_file_ext, rb_find_file), process.c (proc_exec_v), (rb_proc_exec, proc_spawn_v, proc_spawn), ruby.c (process_options): use reentrant versions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e