public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME?
@ 2008-06-22  7:35 Michael Kerrisk
  2008-06-23  8:34 ` Bart Van Assche
  0 siblings, 1 reply; 14+ messages in thread
From: Michael Kerrisk @ 2008-06-22  7:35 UTC (permalink / raw)
  To: lkml; +Cc: Thomas Gleixner, john stultz, Ingo Molnar, Roman Zippel

Thomas,

(I gues you are the right target for this?)

The POSIX.1 specification of nanosleep() says:

        But, except for the case of being interrupted by a signal, the
        suspension time shall not be less than the time  specified  by
        rqtp, as measured by the system clock CLOCK_REALTIME.


However, reading kernel/hrtimer.c:sys_nanosleep(), it appears that
CLOCK_MONOTONIC is used.

     return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);

Is there a reason to use CLOCK_MONOTONIC, instead of CLOCK_REALTIME?  Is it
intentional?  If yes, then I should document this in the man-pages.  If not,
then it should be fixed.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages onlne: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-06-25  6:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22  7:35 nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME? Michael Kerrisk
2008-06-23  8:34 ` Bart Van Assche
2008-06-23  9:48   ` Michael Kerrisk
2008-06-23 11:56     ` Bart Van Assche
2008-06-24  5:08       ` Michael Kerrisk
2008-06-24  5:18       ` Michael Kerrisk
2008-06-23 12:43     ` Roman Zippel
2008-06-24  5:39       ` Michael Kerrisk
2008-06-24  8:01         ` Bart Van Assche
2008-06-24  8:27           ` Michael Kerrisk
2008-06-24  9:27             ` Bart Van Assche
2008-06-24  9:31               ` Michael Kerrisk
2008-06-25  6:13         ` Thomas Gleixner
2008-06-25  6:16           ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox