mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add documents on Process::CLOCK_* constants
* process.c: Add documents on Process::CLOCK_* constants. Patch by Sunao Komuro <sunao-komuro@cookpad.com>. Closes [GH-1567] [Bug #13386] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
225435514c
commit
af4b7c8e86
1 changed files with 26 additions and 0 deletions
26
process.c
26
process.c
|
@ -7805,78 +7805,104 @@ InitVM_process(void)
|
|||
rb_define_module_function(rb_mProcess, "times", rb_proc_times, 0);
|
||||
|
||||
#ifdef CLOCK_REALTIME
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME", CLOCKID2NUM(CLOCK_REALTIME));
|
||||
#elif defined(RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME)
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME", RUBY_GETTIMEOFDAY_BASED_CLOCK_REALTIME);
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", CLOCKID2NUM(CLOCK_MONOTONIC));
|
||||
#elif defined(RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC)
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", RUBY_MACH_ABSOLUTE_TIME_BASED_CLOCK_MONOTONIC);
|
||||
#endif
|
||||
#ifdef CLOCK_PROCESS_CPUTIME_ID
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_PROCESS_CPUTIME_ID", CLOCKID2NUM(CLOCK_PROCESS_CPUTIME_ID));
|
||||
#elif defined(RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID)
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_PROCESS_CPUTIME_ID", RUBY_GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID);
|
||||
#endif
|
||||
#ifdef CLOCK_THREAD_CPUTIME_ID
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_THREAD_CPUTIME_ID", CLOCKID2NUM(CLOCK_THREAD_CPUTIME_ID));
|
||||
#endif
|
||||
#ifdef CLOCK_VIRTUAL
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_VIRTUAL", CLOCKID2NUM(CLOCK_VIRTUAL));
|
||||
#endif
|
||||
#ifdef CLOCK_PROF
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_PROF", CLOCKID2NUM(CLOCK_PROF));
|
||||
#endif
|
||||
#ifdef CLOCK_REALTIME_FAST
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME_FAST", CLOCKID2NUM(CLOCK_REALTIME_FAST));
|
||||
#endif
|
||||
#ifdef CLOCK_REALTIME_PRECISE
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME_PRECISE", CLOCKID2NUM(CLOCK_REALTIME_PRECISE));
|
||||
#endif
|
||||
#ifdef CLOCK_REALTIME_COARSE
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME_COARSE", CLOCKID2NUM(CLOCK_REALTIME_COARSE));
|
||||
#endif
|
||||
#ifdef CLOCK_REALTIME_ALARM
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME_ALARM", CLOCKID2NUM(CLOCK_REALTIME_ALARM));
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC_FAST
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_FAST", CLOCKID2NUM(CLOCK_MONOTONIC_FAST));
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC_PRECISE
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_PRECISE", CLOCKID2NUM(CLOCK_MONOTONIC_PRECISE));
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC_RAW
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW", CLOCKID2NUM(CLOCK_MONOTONIC_RAW));
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC_RAW_APPROX
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW_APPROX", CLOCKID2NUM(CLOCK_MONOTONIC_RAW_APPROX));
|
||||
#endif
|
||||
#ifdef CLOCK_MONOTONIC_COARSE
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_COARSE", CLOCKID2NUM(CLOCK_MONOTONIC_COARSE));
|
||||
#endif
|
||||
#ifdef CLOCK_BOOTTIME
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_BOOTTIME", CLOCKID2NUM(CLOCK_BOOTTIME));
|
||||
#endif
|
||||
#ifdef CLOCK_BOOTTIME_ALARM
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_BOOTTIME_ALARM", CLOCKID2NUM(CLOCK_BOOTTIME_ALARM));
|
||||
#endif
|
||||
#ifdef CLOCK_UPTIME
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_UPTIME", CLOCKID2NUM(CLOCK_UPTIME));
|
||||
#endif
|
||||
#ifdef CLOCK_UPTIME_FAST
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_UPTIME_FAST", CLOCKID2NUM(CLOCK_UPTIME_FAST));
|
||||
#endif
|
||||
#ifdef CLOCK_UPTIME_PRECISE
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_UPTIME_PRECISE", CLOCKID2NUM(CLOCK_UPTIME_PRECISE));
|
||||
#endif
|
||||
#ifdef CLOCK_UPTIME_RAW
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW", CLOCKID2NUM(CLOCK_UPTIME_RAW));
|
||||
#endif
|
||||
#ifdef CLOCK_UPTIME_RAW_APPROX
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW_APPROX", CLOCKID2NUM(CLOCK_UPTIME_RAW_APPROX));
|
||||
#endif
|
||||
#ifdef CLOCK_SECOND
|
||||
/* see Process.clock_gettime */
|
||||
rb_define_const(rb_mProcess, "CLOCK_SECOND", CLOCKID2NUM(CLOCK_SECOND));
|
||||
#endif
|
||||
rb_define_module_function(rb_mProcess, "clock_gettime", rb_clock_gettime, -1);
|
||||
|
|
Loading…
Reference in a new issue