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?
Power management, mobile and firmware developer on Linux. Security developer at Aurora. Ex-biologist. mjg59 on Twitter. Content here should not be interpreted as the opinion of my employer. Also on Mastodon.
no subject
Date: 2011-11-17 02:48 pm (UTC)