aboutsummaryrefslogtreecommitdiff
path: root/bin/sleep/sleep.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Remove unused includes.Xin LI2020-12-231-2/+0
|
* Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`.Mariusz Zaborski2018-06-191-1/+1
| | | | | | | No functional change intended. Notes: svn path=/head/; revision=335395
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Capsicumize some trivial stdio programsConrad Meyer2016-11-081-0/+4
| | | | | | | | | | | | Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. No objection from: allanjude, emaste, oshogbo Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8307 Notes: svn path=/head/; revision=308432
* sleep: Explain in a comment why the [EINTR] check is there.Jilles Tjoelker2013-06-051-0/+6
| | | | | | | Suggested by: eadler Notes: svn path=/head/; revision=251433
* sleep: Improve nanosleep() error handling:Jilles Tjoelker2013-05-281-2/+3
| | | | | | | | | | | | * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Notes: svn path=/head/; revision=251078
* Simplify argument parser by using sscanf(); simplify usage() by notKonstantin Belousov2010-08-021-72/+19
| | | | | | | | | | | | | refusing to use stdio. Reduce nesting level in the sleep loop by returning earlier for negative timeouts. Limit the maximum timeout to INT_MAX seconds. Submitted by: bde MFC after: 3 weeks Notes: svn path=/head/; revision=210749
* Deal with proper format for printing time_t.Konstantin Belousov2010-07-311-3/+5
| | | | | | | | Reported by: ache MFC after: 3 weeks Notes: svn path=/head/; revision=210696
* Report the time left for the sleep on SIGINFO.Konstantin Belousov2010-07-311-19/+47
| | | | | | | | | | Be stricter in the checking of interval specification. PR: bin/139345 MFC after: 3 weeks Notes: svn path=/head/; revision=210679
* Fix a comment.Stefan Farfeleder2005-08-071-1/+1
| | | | | | | Submitted by: Liam J. Foy Notes: svn path=/head/; revision=148816
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-101-1/+1
| | | | Notes: svn path=/head/; revision=139969
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-061-4/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Fix warnings. This is now WARNS=9, std=c99 clean in i386.Mark Murray2003-05-031-9/+10
| | | | | | | | Use return(0) for main() instead of exit(0). Makes it a wee bit smaller. Notes: svn path=/head/; revision=114575
* Quiet warnings about copyright[].David E. O'Brien2003-05-011-2/+2
| | | | Notes: svn path=/head/; revision=114433
* Minimal take on previous commit -- remove getopt and printf. Static sizeNate Lawson2002-11-141-15/+9
| | | | | | | | | | | | is reduced by 40k, dynamic by a few bytes. Functional changes: * "sleep -- arg" now returns usage() instead of ignoring the -- * "sleep -1" now returns immediately instead of returning usage() Reviewed by: jmallett Notes: svn path=/head/; revision=106883
* Back out previous commit since there is controversy about changing so muchNate Lawson2002-11-141-24/+30
| | | | | | | | in sleep including duping strtol(3). Code changes also increased dynamic size of sleep(1). Notes: svn path=/head/; revision=106882
* Remove getopt and strtol dependencies, reducing size of static exe.Nate Lawson2002-11-131-30/+24
| | | | | | | | | | | | | | | Preserve older desired behavior, accept [+-]*[0-9]*\.[0-9]* Remove a few unnecessary casts. %ls -l /bin/sleep -r-xr-xr-x 1 root wheel 61332 Oct 28 05:16 /bin/sleep %ls -l /usr/obj/usr/src/bin/sleep/sleep -rwxr-xr-x 1 root wheel 19124 Nov 13 12:12 /usr/obj/usr/src/bin/sleep/sleep Submitted by: Tim Kientzle <kientzle@acm.org> Notes: svn path=/head/; revision=106874
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-2/+2
| | | | Notes: svn path=/head/; revision=99110
* o __P has been reovedWarner Losh2002-02-021-6/+3
| | | | | | | | | | | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ... Notes: svn path=/head/; revision=90111
* Silence WARNS=2 and BDECFLAGS on alpha and i386Kris Kennaway2001-05-201-0/+1
| | | | | | | MFC After: 1 week Notes: svn path=/head/; revision=76881
* Let sleep(1) handle fractions of a second (up to nanosecond).Ruslan Ermilov1999-10-011-4/+56
| | | | | | | | | | This is a conservative change. It does the same thing in weird cases like the old one. For example, 'sleep abcd' still sleeps for zero seconds. `sleep 10.a' and `sleep 10.05aa' do the best and not abort (ie: 10.a == 10 seconds, 10.05a == 10.05 seconds). Notes: svn path=/head/; revision=51835
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50471
* Correct use of .Nm. Add rcsid.Philippe Charnier1998-05-181-3/+5
| | | | Notes: svn path=/head/; revision=36152
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-281-2/+2
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24348
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=22988
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Cleanup man page and -Wall cleaning.Steve Price1996-12-141-3/+3
| | | | Notes: svn path=/head/; revision=20423
* Added $Id$David Greenman1994-09-241-0/+2
| | | | Notes: svn path=/head/; revision=3044
* BSD 4.4 Lite bin SourcesRodney W. Grimes1994-05-261-0/+80
Notes: svn path=/head/; revision=1556