Matthew Garrett ([personal profile] mjg59) wrote 2011-11-17 02:48 pm (UTC)

It's a good question. The Single UNIX Spec doesn't seem entirely clear on what the expected semantics of sleep() (and alarm()) are - the relevant description is limited to "The sleep() function shall cause the calling thread to be suspended from execution until either the number of realtime seconds specified by the argument seconds has elapsed or a signal is delivered to the calling thread". "Realtime seconds" doesn't appear to be defined. The section on POSIX timers talks about "real time" rather than "realtime". So really, who knows what the correct behaviour for sleep() should be?

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org