aboutsummaryrefslogtreecommitdiffstats
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-14 13:10:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-14 13:10:25 +0000
commita03ea378e79048ac188c8e4211ed2305e4643558 (patch)
treeff0d275b5770262fc9a3aa89028465eeb3cfae64 /process.c
parent93f7a11539dd1102a524b686d66a0aa5576be103 (diff)
downloadruby-a03ea378e79048ac188c8e4211ed2305e4643558.tar.gz
prefer clock_gettime
* configure.ac: clock_gettime or gettimeofday must exist. * process.c (rb_clock_gettime): prefer clock_gettime over gettimeofday, as the latter is obsolete in SUSv4. * random.c (fill_random_seed): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/process.c b/process.c
index ca172d3e56..9e242a2605 100644
--- a/process.c
+++ b/process.c
@@ -7340,8 +7340,9 @@ rb_clock_gettime(int argc, VALUE *argv)
if (SYMBOL_P(clk_id)) {
/*
* Non-clock_gettime clocks are provided by symbol clk_id.
- *
- * gettimeofday is always available on platforms supported by Ruby.
+ */
+#ifdef HAVE_GETTIMEOFDAY
+ /*
* GETTIMEOFDAY_BASED_CLOCK_REALTIME is used for
* CLOCK_REALTIME if clock_gettime is not available.
*/
@@ -7356,6 +7357,7 @@ rb_clock_gettime(int argc, VALUE *argv)
denominators[num_denominators++] = 1000000000;
goto success;
}
+#endif
#define RUBY_TIME_BASED_CLOCK_REALTIME ID2SYM(id_TIME_BASED_CLOCK_REALTIME)
if (clk_id == RUBY_TIME_BASED_CLOCK_REALTIME) {