aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
Commit message (Collapse)AuthorAgeFilesLines
* * process.c (OBJ2UID1): Defined even if getpwnam_r is not usable.akr2014-04-091-0/+4
| | | | | | | | | (OBJ2GID1): Defined even if getgrnam_r is not usable. This fixes compilation error on Android. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: preserve encodingsnobu2014-03-301-2/+2
| | | | | | | * process.c (rlimit_resource_type, rlimit_resource_value): preserve argument encoding in error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: constifynobu2014-03-171-2/+6
| | | | | | * process.c (rb_execarg_new, rb_execarg_init): constify argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: expand buffer on ERANGEnobu2014-03-081-4/+24
| | | | | | | | | * process.c (obj2uid, obj2gid): now getpwnam_r() and getgrnam_r() may need larger buffers than sysconf values, so retry with expanding the buffer when ERANGE is returned. [ruby-core:61325] [Bug #9600] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: need capacitynobu2014-03-081-2/+4
| | | | | | | * process.c (obj2uid, obj2gid): need capacity as buffer size, not length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: GETPW_R_SIZE_INIT, GETGR_R_SIZE_INITnobu2014-03-081-4/+8
| | | | | | | * process.c (GETPW_R_SIZE_INIT, GETGR_R_SIZE_INIT): sysconf values are not maximum sizes, but initial sizes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: tmp buffer instead of allocanobu2014-03-081-34/+81
| | | | | | | | | | | | | * process.c (OBJ2UID1, OBJ2GID1): separate from OBJ2UID and OBJ2GID respectively, need given buffers. * process.c (OBJ2UID, OBJ2GID): no longer need PREPARE_GETPWNAM and PREPARE_GETGRNAM. * process.c (obj2uid, obj2gid): use tmp buffer instead of alloca to get rid of potential stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: [DOC] typo fix by @jkassemi [fix GH-544][ci skip]hsbt2014-02-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h,akr2014-02-141-141/+6
| | | | | | | | | | | | | | | | | | | | | include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [ruby-core:60581] [Feature #9502] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (READ_FROM_CHILD): Apply the last hunk ofakr2014-01-281-1/+1
| | | | | | | | | 0001-process.c-avoid-EINTR-from-Process.spawn.patch written by Eric Wong in [Bug #8770]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: avoid EINTR from Process.spawnnobu2014-01-251-8/+29
| | | | | | | | | * process.c (send_child_error): retry write on EINTR to fix occasional Errno::EINTR from Process.spawn. * process.c (recv_child_error): retry read on EINTR to fix occasional Errno::EINTR from Process.spawn. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (recv_child_error): Fix deadlock in rb_fork_internal when acharliesome2014-01-231-1/+4
| | | | | | | | signal is sent to the parent process while Ruby is forking in IO.popen. Patch by Scott Francis. Closes GH-513. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN intoko12013-12-201-2/+2
| | | | | | | | | | | | RB_OBJ_WRITE and RB_OBJ_WRITTEN. * array.c, class.c, compile.c, hash.c, internal.h, iseq.c, proc.c, process.c, re.c, string.c, variable.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (make_clock_result): add :second as a unit fornaruse2013-12-161-0/+4
| | | | | | Process.clock_gettime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_or): use RHASH_TBL_RAW instead of RHASH_TBLcharliesome2013-12-081-5/+7
| | | | | | | | | | | | * process.c (rb_execarg_fixup): use RHASH_TBL_RAW and insert write barriers where appropriate * vm.c (kwmerge_i): use RHASH_TBL_RAW * vm.c (HASH_ASET): use rb_hash_aset instead of calling directly into st_insert git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLISTnobu2013-11-291-1/+1
| | | | | | | * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration argument list of rb_block_call_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby/ruby.h: add blockarg to rb_block_call_funcnobu2013-11-291-1/+1
| | | | | | | * include/ruby/ruby.h (rb_block_call_func): add blockarg. block function can take block argument, e.g., proc {|&blockarg| ...}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: rb_w32_dup2nobu2013-11-281-12/+2
| | | | | | | * win32/win32.c (rb_w32_dup2): extract from rb_cloexec_dup2() and redirect_dup2(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko12013-10-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: Process::Tmsnobu2013-10-271-3/+4
| | | | | | | | * process.c (Init_process): rename Struct::Tms as Process::Tms. keep the former defined for the backward compatibility, for the time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: Fix a typo. MacOS X don't have ENOTSUPP.akr2013-10-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: remove cloexec settingnobu2013-09-211-4/+0
| | | | | | | | * process.c (rb_fork_internal): remove cloexec setting on pipes created by rb_cloexec_pipe. patch by normalperson (Eric Wong) at [ruby-core:56523]. [Bug #8769] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: Remove spaces between SI prefix and unit to followakr2013-09-091-6/+6
| | | | | | | | | | | | | | SI brochure. http://www.bipm.org/en/si/si_brochure/ https://www.nmij.jp/library/units/si/ * time.c: Ditto. * ext/socket/ancdata.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): Support times() based monotonic clock.akr2013-09-031-0/+38
| | | | | | | | (rb_clock_getres): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (get_mach_timebase_info): Extracted from rb_clock_gettime.akr2013-09-011-10/+27
| | | | | | | | | (rb_clock_gettime): Use get_mach_timebase_info. (rb_clock_getres): Support MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: suppress warningnobu2013-09-011-4/+2
| | | | | | | * process.c (rb_clock_getres): move conditionally used variable to the proper block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_getres): New method.akr2013-08-311-0/+151
| | | | | | | | | | | | | | (timetick2dblnum_reciprocal): New function. * configure.in: Check clock_getres. [ruby-core:56780] [Feature #8809] accepted at DevelopersMeeting20130831Japan https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130831Japan git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typokazu2013-08-261-2/+2
| | | | | | * process.c (gcd_timetick_int): Renamed from gcd_timtick_int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC]akr2013-08-241-5/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [DOC]akr2013-08-241-13/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): The emulated clock names changed.akr2013-08-241-24/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): Add a cast to fix compile error byakr2013-08-231-1/+1
| | | | | | | | -Werror,-Wshorten-64-to-32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: no symbol cachenobu2013-08-231-0/+2
| | | | | | * process.c (rb_intern): no symbol cache while initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (reduce_factors): New function.akr2013-08-231-60/+107
| | | | | | | | | | | (timetick2dblnum): Use reduce_factors. (timetick2integer): Ditto. (make_clock_result): Follow the above change. (rb_clock_gettime): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (timetick_int_t): Renamed from timetick_giga_count_t.akr2013-08-231-43/+41
| | | | | | | | | | | | | | (gcd_timtick_int): Renamed from gcd_ul and make the arguments timetick_giga_count_t. (reduce_fraction): Make the arguments timetick_int_t. (timetick2integer): Ditto. (make_clock_result): Ditto. (timetick2dblnum): Fix the return type. (rb_clock_gettime): Use timetick_int_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix the previous commit.akr2013-08-231-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (gcd_ul): New function.akr2013-08-231-59/+147
| | | | | | | | | | | | | (reduce_fraction): Ditto. (reduce_fraction): Ditto. (timetick2dblnum): Ditto. (timetick2integer): Ditto. (make_clock_result): Use timetick2dblnum and timetick2integer. (rb_clock_gettime): Follow the make_clock_result change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: suppress warningsnobu2013-08-231-2/+2
| | | | | | | * process.c (rb_clock_gettime): cast for tv_nsec explicitly to suppress warnings by VC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): Strip "s" from unit names.akr2013-08-221-12/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (unsigned_clock_t): Defined.akr2013-08-221-4/+15
| | | | | | | | | | | (rb_clock_gettime): Consider clock_t overflow for ISO_C_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID. * configure.in: Check the size of clock_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Exchange order of ISO_C_CLOCK_BASED_CLOCK_PROCESS_CPUTIME_ID andakr2013-08-211-22/+22
| | | | | | | POSIX_TIMES_BASED_CLOCK_PROCESS_CPUTIME_ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): Change emulation symbols forakr2013-08-211-29/+33
| | | | | | | | Process.clock_gettime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (make_clock_result): Extracted from rb_clock_gettime.akr2013-08-211-41/+48
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): clock() based CLOCK_PROCESS_CPUTIME_IDakr2013-08-211-3/+25
| | | | | | | | emulation implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_proc_times): Use RB_GC_GUARD to guard objects from GC.akr2013-08-211-6/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (get_clk_tck): Extracted from rb_proc_times.akr2013-08-211-15/+45
| | | | | | | | | (rb_clock_gettime): times() based CLOCK_PROCESS_CPUTIME_ID emulation is implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c: POSIX_GETTIMEOFDAY_CLOCK_REALTIME is renamed toakr2013-08-211-7/+7
| | | | | | | | SUS_GETTIMEOFDAY_CLOCK_REALTIME. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_clock_gettime): CLOCK_PROCESS_CPUTIME_ID emulationakr2013-08-211-2/+31
| | | | | | | | using getrusage is implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: retry fork if ENOMEMnobu2013-08-191-7/+13
| | | | | | | * process.c (retry_fork): retry with GC if ENOMEM occurred, to free swap/kernel space. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (Init_process): Add constants: CLOCK_REALTIME_ALARM andakr2013-08-191-1/+8
| | | | | | | | CLOCK_BOOTTIME_ALARM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e