On Fri, Feb 22, 2008 at 05:14:47PM +0200, Andrew Pogrebennyk wrote: >Additionally, this C routine is considered obsolete Can you provide a reference for this please. > (unlike shell command by the same name). I've never seen a shell function called usleep. Which shell are you using? > The interaction of this function with SIGALRM >and other timer functions such as sleep(), alarm(), setitimer(), and >nanosleep() is unspecified. Possibly on some OSs but not on FreeBSD. > Additionally, its use in multi-threaded >programs can lead to somewhat surprising results. Such as? If you are talking about having the process suspended instead of the thread then this is dependent on the threading library and the thread attributes and is no more or less surprising than any other similar function. > Use nanosleep(2) or setitimer(2) instead. If you bothered to read what Sharad had said, the man page or the source, you would find that usleep(3) _is_ implemented using nanosleep(2) so there is no point in using nanosleep() instead of usleep(). -- Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour.
Description: PGP signature