summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_process.rb
Commit message (Collapse)AuthorAgeFilesLines
* * process.c, include/ruby/intern.h (rb_run_exec_options): externed.usa2008-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | * 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
* * test/ruby/test_process.rb (TestProcess#with_stdin): defined.akr2008-05-111-8/+24
| | | | | | | | (TestProcess#test_argv0_noarg): don't use redirect_fds. [ruby-dev:34647] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-04-301-0/+68
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use fork method.akr2008-04-301-123/+82
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (check_exec_redirect_fd): prohibit duplex IO.akr2008-04-301-0/+18
| | | | | | | | | (check_exec_fds): record maxhint even if close_others is not specified. (rb_exec_arg_fixup): renamed from rb_exec_arg_fix. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-04-291-0/+41
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-04-271-2/+197
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't use Unix commands such as true, env, etc.akr2008-04-261-108/+131
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_hash_dup): declared.akr2008-04-261-0/+15
| | | | | | | | | | * hash.c (rb_hash_dup): new function. * process.c (rb_spawn_internal): don't modify option hash. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_spawn_internal): new function to specifyakr2008-04-251-2/+7
| | | | | | | | | | default_close_others. (rb_spawn): specify default_close_others true. (rb_f_system): call rb_spawn_internal with default_close_others as false. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* FreeBSD ash doesn't fail with echo >&4 where 4 is not opened.akr2008-04-241-6/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: include sys/stat.h for umask.akr2008-04-241-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_env_clear): declared.akr2008-04-241-0/+430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (rb_io_mode_modenum): declared. (rb_close_before_exec): declared. (struct rb_exec_arg): add options and redirect_fds field. (rb_check_argv): removed. (rb_exec_initarg): declared. (rb_exec_getargs): declared. (rb_exec_initarg2): declared. (rb_fork): add third argument: fds. * io.c (max_file_descriptor): new static variable to record maximum file descriptor ruby used. (UPDATE_MAXFD): new macro. (UPDATE_MAXFD_PIPE): new macro. (rb_io_mode_modenum): externed. (rb_sysopen): update max_file_descriptor. (rb_close_before_exec): new function. (popen_exec): redirection removed because it is done by extended spawn mechanism. (pipe_open): generate a hash for spawn options to specify redirections. (pipe_open_v): use rb_exec_getargs. (pipe_open_s): use rb_exec_getargs. (rb_io_initialize): update max_file_descriptor.. * process.c (hide_obj): new function. (check_exec_redirect_fd): new function. (check_exec_redirect): new function. (check_exec_options_i): new function. (check_exec_fds): new function. (rb_check_exec_options): new function. (check_exec_env_i): new function. (rb_check_exec_env): new function. (rb_exec_getargs): new function. (rb_exec_initarg2): new function. (rb_exec_initarg): new function. (rb_f_exec): use rb_exec_initarg. (intcmp): new function. (run_exec_dup2): new function. (run_exec_close): new function. (run_exec_open): new function. (run_exec_pgroup): new function. (run_exec_rlimit): new function. (run_exec_options): new function. (rb_exec): call run_exec_options. (move_fds_to_avoid_crash): new function. (pipe_nocrash): new function. (rb_fork): use pipe_nocrash to avoid file descriptor conflicts. (rb_spawn): use rb_exec_initarg. (rlimit_resource_name2int): extracted from rlimit_resource_type. (rlimit_type_by_hname): new function. (rlimit_type_by_lname): new function. (rlimit_resource_type): use rlimit_type_by_hname. (proc_daemon): add fds argument for rb_fork. * hash.c (rb_env_clear): renamed from env_clear and externed. [ruby-dev:34086] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_process.rb (test_rlimit_nofile): reset RLIMIT_NOFILEmame2008-04-161-6/+10
| | | | | | | | | before exit (for gcov). * test/ruby/test_rubyoptions.rb: new tests for option of ruby interpreter, to achieve over 95% test coverage of ruby.c. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rlimit_resource_type): new function.akr2008-02-221-0/+32
| | | | | | | | | | | (rlimit_resource_value): new function. (proc_getrlimit): use rlimit_resource_type to accept symbol and string as resource type. (proc_setrlimit): use rlimit_resource_type and rlimit_resource_value to accept symbol and string as resource type and values. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* report the reason of process termination.akr2007-11-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_process.rb (TestProcess#test_rlimit_nofile):akr2006-07-311-1/+5
| | | | | | | | setrlimit may fail with EINVAL. reported by MIYAMUKO Katsuyuki. [ruby-dev:29174] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use fork to isolate rlimit effect.akr2006-06-211-7/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add RLIMIT_NOFILE testakr2006-06-151-1/+20
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* give dummy argument for Process.getrlimit and rescue TypeError.akr2006-06-151-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* new file.akr2006-06-151-0/+13
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e