Bug 73371 - sleep(): which clock ?
Summary: sleep(): which clock ?
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-02 10:09 UTC by Mike Frysinger
Modified: 2016-12-13 08:34 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Mike Frysinger 2014-04-02 10:09:41 UTC
the current man page states:
       sleep() makes the calling thread sleep until seconds seconds have elapsed or a signal arrives which is not ignored.

unfortunately, the NOTES section does not discuss which clock is being used.  the nanosleep man page has a good discussion on the topic, and presumably the answer is the same ?
Comment 1 Michael Kerrisk 2016-12-13 08:34:33 UTC
I've made the following changes to the man page. 

1. Mention "real-time" seconds in the description of how long sleep() sleeps for.

2. Added the following text in NOTES:

       On  Linux,  sleep()  is  implemented  via  nanosleep(2).   See the
       nanosleep(2) man page for a discussion of the clock used.

I'm closing this bug. Please reopen if you think anything further is required.

Note You need to log in before you can comment on or make changes to this bug.