From cd9f60dfa5a16d4fb0dc25504f27fc1f905a0835 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 24 Aug 2013 02:19:41 +0000 Subject: [PATCH] [DOC] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/process.c b/process.c index 02fe0ba5c1..68a21064e4 100644 --- a/process.c +++ b/process.c @@ -6867,7 +6867,12 @@ make_clock_result(struct timetick *ttp, * [CLOCK_UPTIME_PRECISE] FreeBSD 8.1 * [CLOCK_SECOND] FreeBSD 8.1 * - * Also, several other symbols are accepted as +clock_id+. + * Note that SUS stands for Single Unix Specification. + * SUS contains POSIX and clock_gettime is defined in the POSIX part. + * SUS defines CLOCK_REALTIME mandatory but + * CLOCK_MONOTONIC, CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are optional. + * + * Also, several symbols are accepted as +clock_id+. * There are emulations for clock_gettime(). * * For example, Process::CLOCK_REALTIME is defined as @@ -6875,7 +6880,7 @@ make_clock_result(struct timetick *ttp, * * Emulations for +CLOCK_REALTIME+: * [:GETTIMEOFDAY_BASED_CLOCK_REALTIME] - * Use gettimeofday() defined by Single Unix Specification. + * Use gettimeofday() defined by SUS. * (SUSv4 obsoleted it, though.) * The resolution is 1 micro second. * [:TIME_BASED_CLOCK_REALTIME] @@ -6889,7 +6894,7 @@ make_clock_result(struct timetick *ttp, * * Emulations for +CLOCK_PROCESS_CPUTIME_ID+: * [:GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID] - * Use getrusage() defined by Single Unix Specification. + * Use getrusage() defined by SUS. * getrusage() is used with RUSAGE_SELF to obtain the time only for * the calling process (excluding the time for child processes). * The result is addition of user time (ru_utime) and system time (ru_stime). @@ -6906,10 +6911,10 @@ make_clock_result(struct timetick *ttp, * Use clock() defined by ISO C. * The resolution is 1/CLOCKS_PER_SEC. * CLOCKS_PER_SEC is the C-level macro defined by time.h. - * Single Unix Specification defines CLOCKS_PER_SEC is 1000000. + * SUS defines CLOCKS_PER_SEC is 1000000. * Non-Unix systems may define it a different value, though. * If CLOCKS_PER_SEC is 1000000 as SUS, the resolution is 1 micro second. - * If clock_t is 32 bit and CLOCKS_PER_SEC is 1000000, it overflows for each 72 minutes. + * If CLOCKS_PER_SEC is 1000000 and clock_t is 32 bits integer type, it cannot represent over 72 minutes. * * If the given +clock_id+ is not supported, Errno::EINVAL is raised. *