summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/sleep.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix LONG_MAX overflowingache1997-10-171-10/+21
| | | | | | Return seconds if errno other than EINTR Add $Id Submitted by: bde with minor optimization by me
* Copy time_to_sleep to time_remaining since it can be leftache1997-10-161-0/+1
| | | | uninitialized if nanosleep returns early with agr error
* Cleanup #includesache1997-10-161-2/+1
|
* Give up on the "try and compensate for broken programs" cruft and revertpeter1997-10-151-70/+0
| | | | | | | | | | | | | back to the original single nanosleep() implementation. This is POSIX and Unix98 (aka single-unix spec v2) compliant behavior. If a program sets alarm(2) or an interval timer (setitimer(2)) without a SIGALRM handler being active, sleep(3) will no longer absorb it, and the program will get what it asked for..... :-] The original reason for this in the first place (apache) doesn't seem to need it anymore, according to Andrey. Reviewed by: ache, bde
* Back out itimerfix hack since nanosleep1 fixed nowache1997-08-131-58/+19
| | | | Handle syscalls error return slightly better
* Rearrange itimerfix loop doing it inside SIGALRM handling sectionache1997-08-121-19/+20
|
* Solve itimerfix() problem completely by using loop in 100000000 secs chunksache1997-08-121-0/+19
|
* Back out my installation of SIGALRM handler even if it is blockedache1997-08-121-19/+29
| | | | | | | and return to previous Peter's variant. POSIX says that this place is implementation defined and old variant allows application block SIGALRM and sleep and not be killed by external SIGALRMs. BTW, GNU sleep f.e. sleeps forever in blocked SIGALRM :-)
* Make itimerfix hack better: return the time we can't sleep at onceache1997-08-121-12/+20
|
* Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting thejoerg1997-08-101-0/+16
| | | | | | | | | acceptable range for tv_sec to the magic number 100000000 (which at least ought to be declared in a header file, and explained in the non-existing man page, as well as in the existing man pages for nanosleep(2) & Co.). PR: bin/4259
* Make sleep() and usleep() "eat" any stray SIGALRM signals during thepeter1997-07-181-25/+15
| | | | | | | | lifetime of the call, just like the old implementation did. Previously, we were only eating them if the application did not call sleep()/usleep() with SIGALRM masked. Submitted by: ache
* Re-activate the nanosleep style using code, but with the signal handlingpeter1997-06-021-53/+1
| | | | | | | | | | semantics of the old sleep for compatability with a few decades of expected side effects. Apache breaks if we just use nanosleep() for some reason, here we use a new signanosleep() syscall which is kinda like a hybrid of sigsuspend and nanosleep.. Reviewed by: ache (and tested on his apache that was failing when sleep used plain nanosleep)
* Update the sleep(3)/usleep(3) code to use signanosleep(2) if compiled withpeter1997-06-011-9/+59
| | | | | | | -DUSE_NANOSLEEP. Also, seperate the code for _THREAD_SAFE so that it uses the simpler threaded nanosleep() call in libc_r.. We don't go to the same extremes for emulating traditional sleep semantics (ie: eating any SIGALRM that might happen) which things like apache seem to depend on.
* Update the nanosleep versions to set a SIGALRM handler while sleeping.peter1997-05-181-2/+9
| | | | | This appears to appease Apache, although depending on having sleep(3) changing the SIGALRM handler is a bit bogus.
* round-up non-zero nanoseconds in #ifdef'ed code.peter1997-05-171-0/+2
|
* Allow conditional use (add -DUSE_NANOSLEEP) to CFLAGS of nanosleep() forpeter1997-05-171-19/+18
| | | | | the backend of sleep(3) and usleep(3). It's off by default until the problem is fixed.
* Temporarily restore old (itimer) sleep variant because new oneache1997-05-171-9/+70
| | | | | | | | | | | | | | | (nanosleep) breaks Apache httpd badly: his childs died quickly after number of requests (SIGPIPE). To reproduce this bug start gdb /usr/local/sbin/httpd run -X and make some bunch of concurent requests (load the server pages from 3 different places f.e.) After short time httpd dies via SIGPIPE. It never dies with old sleep.c In real life it looks like lots of broken images on the pages or missing pages. Lynx says about Network read error, etc. It seems something wrong in nanosleep signal handling.
* Use nanosleep() in all cases, not just in the reentrant libc (_THREAD_SAFE)peter1997-05-121-70/+9
| | | | version.
* ts_sec -> tv_secnate1996-09-201-3/+3
| | | | ts_nsec -> tv_nsec
* Reviewed by: julian and (hsu?)julian1996-01-221-0/+20
| | | | | | Submitted by: John Birrel(L?) changes for threadsafe operations
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-221-1/+1
|
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+97
OpenPOWER on IntegriCloud