Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] using rusage



2008/6/20 Curt Sampson <cjs@example.com>:

> What's the difference in the signal handling? From the BSD manpages, it
> looks as if both treat signals in the same way.

Maybe they got it right on BSD. From the Linux manpage:

BUGS
       sleep()  may  be  implemented using SIGALRM; mixing calls to alarm() and
       sleep() is a bad idea.

       Using longjmp() from a signal  handler  or  modifying  the  handling  of
       SIGALRM while sleeping will cause undefined results.

I believe that it was Stevens's "Advanced Programming in the UNIX
Environment" that clued me in to that bug.

> And why do you think nanosleep will get you closer than sleep?

Again, from Stevens (if my flaky memory serves), I seem to remember
that some Unices gave you worse resolution for sleep(3) than for
usleep(2) or nanosleep(3).

Am I mis-remembering?

-- 
Cheers,
Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links