Bug 73371

Summary: sleep(): which clock ?
Product: Documentation Reporter: Mike Frysinger (vapier)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED CODE_FIX    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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.