ruby-changes:44127
From: naruse <ko1@a...>
Date: Wed, 21 Sep 2016 17:46:11 +0900 (JST)
Subject: [ruby-changes:44127] naruse:r56200 (trunk): * process.c (InitVM_process): Support CLOCK_MONOTONIC_RAW_APPROX,
naruse 2016-09-21 17:46:06 +0900 (Wed, 21 Sep 2016) New Revision: 56200 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56200 Log: * process.c (InitVM_process): Support CLOCK_MONOTONIC_RAW_APPROX, CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced by macOS 10.12. Modified files: trunk/ChangeLog trunk/process.c Index: ChangeLog =================================================================== --- ChangeLog (revision 56199) +++ ChangeLog (revision 56200) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Sep 21 17:43:53 2016 NARUSE, Yui <naruse@r...> + + * process.c (InitVM_process): Support CLOCK_MONOTONIC_RAW_APPROX, + CLOCK_UPTIME_RAW, and CLOCK_UPTIME_RAW_APPROX which are introduced + by macOS 10.12. + Wed Sep 21 13:47:33 2016 Nobuyoshi Nakada <nobu@r...> * parse.y (brace_body, do_body): preserve cmdarg_stack so that Index: process.c =================================================================== --- process.c (revision 56199) +++ process.c (revision 56200) @@ -7107,10 +7107,10 @@ get_mach_timebase_info(void) https://github.com/ruby/ruby/blob/trunk/process.c#L7107 * The supported constants depends on OS and version. * Ruby provides following types of +clock_id+ if available. * - * [CLOCK_REALTIME] SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1 - * [CLOCK_MONOTONIC] SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4 - * [CLOCK_PROCESS_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, OpenBSD 5.4 - * [CLOCK_THREAD_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD 5.4 + * [CLOCK_REALTIME] SUSv2 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 2.1, macOS 10.12 + * [CLOCK_MONOTONIC] SUSv3 to 4, Linux 2.5.63, FreeBSD 3.0, NetBSD 2.0, OpenBSD 3.4, macOS 10.12 + * [CLOCK_PROCESS_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, OpenBSD 5.4, macOS 10.12 + * [CLOCK_THREAD_CPUTIME_ID] SUSv3 to 4, Linux 2.5.63, FreeBSD 7.1, OpenBSD 5.4, macOS 10.12 * [CLOCK_VIRTUAL] FreeBSD 3.0, OpenBSD 2.1 * [CLOCK_PROF] FreeBSD 3.0, OpenBSD 2.1 * [CLOCK_REALTIME_FAST] FreeBSD 8.1 @@ -7120,11 +7120,14 @@ get_mach_timebase_info(void) https://github.com/ruby/ruby/blob/trunk/process.c#L7120 * [CLOCK_MONOTONIC_FAST] FreeBSD 8.1 * [CLOCK_MONOTONIC_PRECISE] FreeBSD 8.1 * [CLOCK_MONOTONIC_COARSE] Linux 2.6.32 - * [CLOCK_MONOTONIC_RAW] Linux 2.6.28 + * [CLOCK_MONOTONIC_RAW] Linux 2.6.28, macOS 10.12 + * [CLOCK_MONOTONIC_RAW_APPROX] macOS 10.12 * [CLOCK_BOOTTIME] Linux 2.6.39 * [CLOCK_BOOTTIME_ALARM] Linux 3.0 * [CLOCK_UPTIME] FreeBSD 7.0, OpenBSD 5.5 * [CLOCK_UPTIME_FAST] FreeBSD 8.1 + * [CLOCK_UPTIME_RAW] macOS 10.12 + * [CLOCK_UPTIME_RAW_APPROX] macOS 10.12 * [CLOCK_UPTIME_PRECISE] FreeBSD 8.1 * [CLOCK_SECOND] FreeBSD 8.1 * @@ -7823,6 +7826,9 @@ InitVM_process(void) https://github.com/ruby/ruby/blob/trunk/process.c#L7826 #ifdef CLOCK_MONOTONIC_RAW rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW", CLOCKID2NUM(CLOCK_MONOTONIC_RAW)); #endif +#ifdef CLOCK_MONOTONIC_RAW_APPROX + rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_RAW_APPROX", CLOCKID2NUM(CLOCK_MONOTONIC_RAW_APPROX)); +#endif #ifdef CLOCK_MONOTONIC_COARSE rb_define_const(rb_mProcess, "CLOCK_MONOTONIC_COARSE", CLOCKID2NUM(CLOCK_MONOTONIC_COARSE)); #endif @@ -7841,6 +7847,12 @@ InitVM_process(void) https://github.com/ruby/ruby/blob/trunk/process.c#L7847 #ifdef CLOCK_UPTIME_PRECISE rb_define_const(rb_mProcess, "CLOCK_UPTIME_PRECISE", CLOCKID2NUM(CLOCK_UPTIME_PRECISE)); #endif +#ifdef CLOCK_UPTIME_RAW + rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW", CLOCKID2NUM(CLOCK_UPTIME_RAW)); +#endif +#ifdef CLOCK_UPTIME_RAW_APPROX + rb_define_const(rb_mProcess, "CLOCK_UPTIME_RAW_APPROX", CLOCKID2NUM(CLOCK_UPTIME_RAW_APPROX)); +#endif #ifdef CLOCK_SECOND rb_define_const(rb_mProcess, "CLOCK_SECOND", CLOCKID2NUM(CLOCK_SECOND)); #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/