summaryrefslogtreecommitdiff
path: root/lib/libc/gen/sleep.c
Commit message (Collapse)AuthorAgeFilesLines
* restore rev 1.23 to give clear SIGALRM handling example, 68 yearsAndrey A. Chernov1998-09-081-28/+16
| | | | | | | are too long to affect real code Notes: svn path=/head/; revision=38938
* Reviewed by: Andrey A. Chernov <ache@nagual.pp.ru>, Doug Rabson ↵Matthew Dillon1998-09-061-17/+29
| | | | | | | | | | <dfr@nlsystems.com> Rewrote sleep() to remove int/long typing assumptions between the argument to the function and the timespec structure. Notes: svn path=/head/; revision=38878
* Use INT_MAX instead of LONG_MAX since the variable being comparedJohn Birrell1998-09-051-4/+4
| | | | | | | is an int, not a long. Notes: svn path=/head/; revision=38847
* Fix LONG_MAX overflowingAndrey A. Chernov1997-10-171-10/+21
| | | | | | | | | Return seconds if errno other than EINTR Add $Id Submitted by: bde with minor optimization by me Notes: svn path=/head/; revision=30510
* Copy time_to_sleep to time_remaining since it can be leftAndrey A. Chernov1997-10-161-0/+1
| | | | | | | uninitialized if nanosleep returns early with agr error Notes: svn path=/head/; revision=30493
* Cleanup #includesAndrey A. Chernov1997-10-161-2/+1
| | | | Notes: svn path=/head/; revision=30479
* Give up on the "try and compensate for broken programs" cruft and revertPeter Wemm1997-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 Notes: svn path=/head/; revision=30442
* Back out itimerfix hack since nanosleep1 fixed nowAndrey A. Chernov1997-08-131-58/+19
| | | | | | | Handle syscalls error return slightly better Notes: svn path=/head/; revision=28172
* Rearrange itimerfix loop doing it inside SIGALRM handling sectionAndrey A. Chernov1997-08-121-19/+20
| | | | Notes: svn path=/head/; revision=28128
* Solve itimerfix() problem completely by using loop in 100000000 secs chunksAndrey A. Chernov1997-08-121-0/+19
| | | | Notes: svn path=/head/; revision=28127
* Back out my installation of SIGALRM handler even if it is blockedAndrey A. Chernov1997-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 :-) Notes: svn path=/head/; revision=28125
* Make itimerfix hack better: return the time we can't sleep at onceAndrey A. Chernov1997-08-121-12/+20
| | | | Notes: svn path=/head/; revision=28107
* Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting theJoerg Wunsch1997-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 Notes: svn path=/head/; revision=28033
* Make sleep() and usleep() "eat" any stray SIGALRM signals during thePeter Wemm1997-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 Notes: svn path=/head/; revision=27502
* Re-activate the nanosleep style using code, but with the signal handlingPeter Wemm1997-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) Notes: svn path=/head/; revision=26385
* Update the sleep(3)/usleep(3) code to use signanosleep(2) if compiled withPeter Wemm1997-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. Notes: svn path=/head/; revision=26338
* Update the nanosleep versions to set a SIGALRM handler while sleeping.Peter Wemm1997-05-181-2/+9
| | | | | | | | This appears to appease Apache, although depending on having sleep(3) changing the SIGALRM handler is a bit bogus. Notes: svn path=/head/; revision=25890
* round-up non-zero nanoseconds in #ifdef'ed code.Peter Wemm1997-05-171-0/+2
| | | | Notes: svn path=/head/; revision=25870
* Allow conditional use (add -DUSE_NANOSLEEP) to CFLAGS of nanosleep() forPeter Wemm1997-05-171-19/+18
| | | | | | | | the backend of sleep(3) and usleep(3). It's off by default until the problem is fixed. Notes: svn path=/head/; revision=25862
* Temporarily restore old (itimer) sleep variant because new oneAndrey A. Chernov1997-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. Notes: svn path=/head/; revision=25861
* Use nanosleep() in all cases, not just in the reentrant libc (_THREAD_SAFE)Peter Wemm1997-05-121-70/+9
| | | | | | | version. Notes: svn path=/head/; revision=25739
* ts_sec -> tv_secNate Williams1996-09-201-3/+3
| | | | | | | ts_nsec -> tv_nsec Notes: svn path=/head/; revision=18414
* Reviewed by: julian and (hsu?)Julian Elischer1996-01-221-0/+20
| | | | | | | | | Submitted by: John Birrel(L?) changes for threadsafe operations Notes: svn path=/head/; revision=13545
* Minor cleanup, mostly unused vars and missing #includes.Poul-Henning Kamp1995-10-221-1/+1
| | | | Notes: svn path=/head/; revision=11659
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+97
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573