diff --git a/process.c b/process.c index cd6e59e290..9191051f99 100644 --- a/process.c +++ b/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);