* process.c: POSIX_GETTIMEOFDAY_CLOCK_REALTIME is renamed to
SUS_GETTIMEOFDAY_CLOCK_REALTIME. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
167419848f
commit
a24930bf08
@ -1,3 +1,8 @@
|
|||||||
|
Wed Aug 21 19:31:48 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* process.c: POSIX_GETTIMEOFDAY_CLOCK_REALTIME is renamed to
|
||||||
|
SUS_GETTIMEOFDAY_CLOCK_REALTIME.
|
||||||
|
|
||||||
Wed Aug 21 19:17:46 2013 Tanaka Akira <akr@fsij.org>
|
Wed Aug 21 19:17:46 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* process.c (rb_clock_gettime): CLOCK_PROCESS_CPUTIME_ID emulation
|
* process.c (rb_clock_gettime): CLOCK_PROCESS_CPUTIME_ID emulation
|
||||||
|
14
process.c
14
process.c
@ -6685,10 +6685,10 @@ rb_proc_times(VALUE obj)
|
|||||||
* There are emulations for clock_gettime().
|
* There are emulations for clock_gettime().
|
||||||
*
|
*
|
||||||
* For example, Process::CLOCK_REALTIME is defined as
|
* For example, Process::CLOCK_REALTIME is defined as
|
||||||
* +:POSIX_GETTIMEOFDAY_CLOCK_REALTIME+ when clock_gettime() is not available.
|
* +:SUS_GETTIMEOFDAY_CLOCK_REALTIME+ when clock_gettime() is not available.
|
||||||
*
|
*
|
||||||
* Emulations for +CLOCK_REALTIME+:
|
* Emulations for +CLOCK_REALTIME+:
|
||||||
* [:POSIX_GETTIMEOFDAY_CLOCK_REALTIME] Use gettimeofday(). The resolution is 1 micro second.
|
* [:SUS_GETTIMEOFDAY_CLOCK_REALTIME] Use gettimeofday(). The resolution is 1 micro second.
|
||||||
* [:ISO_C_TIME_CLOCK_REALTIME] Use time(). The resolution is 1 second.
|
* [:ISO_C_TIME_CLOCK_REALTIME] Use time(). The resolution is 1 second.
|
||||||
*
|
*
|
||||||
* Emulations for +CLOCK_MONOTONIC+:
|
* Emulations for +CLOCK_MONOTONIC+:
|
||||||
@ -6746,11 +6746,11 @@ rb_clock_gettime(int argc, VALUE *argv)
|
|||||||
* Non-clock_gettime clocks are provided by symbol clk_id.
|
* Non-clock_gettime clocks are provided by symbol clk_id.
|
||||||
*
|
*
|
||||||
* gettimeofday is always available on platforms supported by Ruby.
|
* gettimeofday is always available on platforms supported by Ruby.
|
||||||
* POSIX_GETTIMEOFDAY_CLOCK_REALTIME is used for
|
* SUS_GETTIMEOFDAY_CLOCK_REALTIME is used for
|
||||||
* CLOCK_REALTIME if clock_gettime is not available.
|
* CLOCK_REALTIME if clock_gettime is not available.
|
||||||
*/
|
*/
|
||||||
#define RUBY_POSIX_GETTIMEOFDAY_CLOCK_REALTIME ID2SYM(rb_intern("POSIX_GETTIMEOFDAY_CLOCK_REALTIME"))
|
#define RUBY_SUS_GETTIMEOFDAY_CLOCK_REALTIME ID2SYM(rb_intern("SUS_GETTIMEOFDAY_CLOCK_REALTIME"))
|
||||||
if (clk_id == RUBY_POSIX_GETTIMEOFDAY_CLOCK_REALTIME) {
|
if (clk_id == RUBY_SUS_GETTIMEOFDAY_CLOCK_REALTIME) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
ret = gettimeofday(&tv, 0);
|
ret = gettimeofday(&tv, 0);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
@ -7126,8 +7126,8 @@ Init_process(void)
|
|||||||
|
|
||||||
#ifdef CLOCK_REALTIME
|
#ifdef CLOCK_REALTIME
|
||||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME", CLOCKID2NUM(CLOCK_REALTIME));
|
rb_define_const(rb_mProcess, "CLOCK_REALTIME", CLOCKID2NUM(CLOCK_REALTIME));
|
||||||
#elif defined(RUBY_POSIX_GETTIMEOFDAY_CLOCK_REALTIME)
|
#elif defined(RUBY_SUS_GETTIMEOFDAY_CLOCK_REALTIME)
|
||||||
rb_define_const(rb_mProcess, "CLOCK_REALTIME", RUBY_POSIX_GETTIMEOFDAY_CLOCK_REALTIME);
|
rb_define_const(rb_mProcess, "CLOCK_REALTIME", RUBY_SUS_GETTIMEOFDAY_CLOCK_REALTIME);
|
||||||
#endif
|
#endif
|
||||||
#ifdef CLOCK_MONOTONIC
|
#ifdef CLOCK_MONOTONIC
|
||||||
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", CLOCKID2NUM(CLOCK_MONOTONIC));
|
rb_define_const(rb_mProcess, "CLOCK_MONOTONIC", CLOCKID2NUM(CLOCK_MONOTONIC));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user