summaryrefslogtreecommitdiffstats
path: root/bin/sleep (follow)
Commit message (Collapse)AuthorAgeFilesLines
* sleep(1): style(9) and other dustingcheloha2020-02-251-20/+17
| | | | | | | | | | | | | | | | | | - Sort includes alphabetically - Sort prototypes alphabetically - Sort stack variables by size - Add missing braces to the getopt(3) loop - Be explicit: there is *one* argument, so use argv[0], not *argv - If nanosleep(2) somehow fails, say that "nanosleep" failed when we err(3) - Remove extra parentheses from the return statement - De-(void) the obvious fprintf(3) in usage() - __progname -> getprogname(3) - POSIX 1003.2 has long since become POSIX.1 - Remove an ARGUSED linter comment - stdio(3) flushing is not the only potential issue with an exit(3) from a signal handler. Just note that exit(3) isn't safe and leave it at that.
* sleep(1): simplify argument parsingcheloha2019-07-011-27/+18
| | | | | | | | | - No need for intermediate variables, just build the timespec directly - Use for-loops so we modify "cp" on a single line in each loop - Parse subseconds with one loop: less code, easier to read, etc. - Improve the subsecond parsing comment: make our intent really obvious ok schwarze@
* Revert nanosleep(2) loop introduced in v1.25.cheloha2019-01-101-17/+9
| | | | | | | Now that nanosleep(2) handles the full input range transparently there is no longer a 100 million second upper bound and we can remove this loop. ok phessler@ jca@ visa@
* Print strtonum(3)-style error messages on invalid numeric input.cheloha2018-02-041-6/+5
| | | | | | | | More informative than the usage message. While here, no need to return EINVAL: just return 1 if we overflow. ok jca@ schwarze@
* Extend range for seconds from 100 million to upper bound of time_t.cheloha2018-02-021-5/+17
| | | | | | | | | Makes us compliant with POSIX.1-2008, which requires that sleep(1) support up to 2147483647 seconds. Bounced off of tb@ and jca@. ok tb@ millert@ jca@
* Add, correct, and improve HISTORY sections.schwarze2016-08-161-2/+7
| | | | | From Sevan Janiyan <venture37 at geeklan dot co dot uk>. Verified using http://minnie.tuhs.org/.
* Don't return errno from main()guenther2015-10-111-2/+2
| | | | ok beck@ doug@ deraadt@ tedu@
* Change all tame callers to namechange to pledge(2).deraadt2015-10-091-3/+3
|
* So you'd love me to say sleep() can be tighter than tame "stdio". OK,deraadt2015-10-031-1/+5
| | | | | | | | | | | | | | | | | there is that pesky usage message... We could tame "something" in the non-usage codepath.. but pop quiz, anyone know what happens after main returns or if exit(3) is called? atexit completion.. our atexit is very paranoid with structure management and uses mprotect. So current minimum a normal program needs is tame "malloc". tame "stdio" done before the usage codepath splits is just as good; tame placement before getopt provides a strong hint about program behaviour. I am still hoping someone comes up with a nice solution for atexit, or a nice tame subset between "" (pure computation) and "malloc". Ideas have been floated to expose "self", but it lacks mprotect also, and should continue to lack it (see the ssh tame sandbox).
* sleep doesn't benefit from setting locale. we always want to parse numberstedu2015-09-221-4/+1
| | | | | | as our forefathers did, and it doesn't print any error messages in need of translation. ok stsp
* document SIGALRM, since it's handling is somewhat special, and usejmc2014-05-271-14/+8
| | | | | | a standard EXIT STATUS blurb now that we can; ok guenther sobrado millert
* remove section 2/3 pointers from section 1,schwarze2014-02-211-8/+3
| | | | | | and do not point programmers at the obsolete usleep(3); based on a diff from Jan Klemkow <j dot klemkow at wemelug dot de>, but removing more as suggested by jmc@ and deraadt@
* add unsigned char casts for specific calls to ctype.h macros.deraadt2013-11-211-4/+4
| | | | ok guenther step
* add an EXIT STATUS section for /bin;jmc2010-09-031-15/+15
|
* move exit returns blurb out of DIAGNOSTICS; from daniel dickmanjmc2010-07-221-5/+5
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-15/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* argv space does not need to be trashed during parsingderaadt2009-02-131-3/+3
|
* bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a fewjmc2009-02-081-3/+3
| | | | updates to follow;
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* - consistent STANDARDS blurbjmc2007-05-291-5/+6
| | | | | | - note which options are extensions to POSIX discussed w/ deraadt otto millert
* fix some dodgy displays;jmc2007-02-061-5/+3
|
* ARGSUSED on signal handlerderaadt2004-09-161-3/+4
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-022-13/+5
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* KNFderaadt2002-09-061-7/+11
|
* ansideraadt2002-07-041-8/+5
|
* Don't include cases for characters not in optstring; ericj. Snuck in on mypjanzen2002-05-311-4/+2
| | | | last commit here.
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-4/+4
|
* o) __progname aria;mpech2001-09-061-4/+5
| | | | millert@ ok.
* trade 3 exits for returnmickey2001-05-201-5/+5
|
* Trailing whitespace begone!aaron2000-04-121-4/+4
|
* Improve.aaron2000-02-191-33/+34
|
* Return EINVAL if we can't sleep for the specified time interval (i.e. it'spjanzen2000-01-052-15/+20
| | | | too long); problem noted by viha@vip.fi
* This sleep accepts fractional timings as well.espie1999-12-061-22/+31
| | | | Rephrase examples slightly.
* awk -> .Xr awk 1aaron1999-09-021-3/+4
|
* always give .Nm macros an argument in SYNOPSIS sections; krw@tcn.netaaron1998-12-151-2/+2
|
* start killing redundant .Nm macro arguments (mandoc ``remembers'' the first oneaaron1998-11-281-6/+6
| | | | it's given)
* alphabetize SEE ALSO entries and numerically order according to sectionaaron1998-09-231-3/+3
|
* First complete sweep of man pages, bin/. Command/function names previouslyaaron1998-09-141-3/+3
| | | | | (incorrectly) capatilized are fixed. Comma splices, hyphenations, SYNOPSIS cleanups, other miscellaneous typos.
* $OpenBSD$deraadt1997-09-211-2/+1
|
* #include <ctype.h>millert1997-09-121-2/+3
|
* Note POSIX 1003.2 conformance.denny1997-08-191-3/+3
|
* POSIX 1003.2: exit w/ 0 code if receive SIGALRM.denny1997-08-191-2/+30
|
* Reject non-numeric argument (so can't use atoi).denny1997-06-291-13/+15
|
* Make sleep handle fractions of a second. Why not?denny1997-06-291-5/+28
|
* getopt(3) returns -1 when out of args, not EOF, whee!millert1997-01-151-3/+3
|
* zap getopt() case of -?, come on, it is the default!deraadt1996-08-021-3/+2
|
* update rcsidderaadt1996-06-233-2/+4
|
* initial import of NetBSD treederaadt1995-10-183-0/+213