Commit Graph

69 Commits

Author SHA1 Message Date
Mateusz Piotrowski
d46d907a26 sleep.1: Fix mdoc style
Fixes:	be038c3afc bin/sleep: add support for multiple delay values
MFC after:	1 week
2022-05-25 10:11:33 +02:00
Stefan Eßer
81cea61f3b bin/sleep: document more non-standard features
Add support of other time units than seconds to the IMPLEMENTATION
NOTES section of the man page.

MFC after:	1 week
2022-05-24 11:31:21 +02:00
Stefan Eßer
be038c3afc bin/sleep: add support for multiple delay values
The sleep time is calculated as the sum of all arguments passed.

This makes the FreeBSD version of sleep functionally compatible with
the version in GNU coreutils.

MFC after:	1 week
2022-05-24 10:47:40 +02:00
A. Mallory
34978f7edd bin/sleep: add support for units other than seconds
The coreutils version of this command accepts a unit designation of s,
m, h, or d (for seconds, minutes, hours, days) immediately following
the number of (fractional) units to delay.

The submitted patch has been modified in one detail: the test meant to
detect the presence of the unit modified was not specific (!= 1) and
would have accepted a non-numeric initial element or extra characters
following the union. The committed version accepts only the number
immediately followed by one of the defined unit designators and no
further characters.

PR:		264162
MFC after:	1 week
2022-05-24 09:43:38 +02:00
Benjamin Kaduk
43d0803c45 Soften caveat about fractional seconds for sleep(1)
Support for fractional seconds has become much more widespread since
this text was originally written.

Reported by:    Mark Eichin
Reviewed by:    gbe, jilles
Differential Revision:  https://reviews.freebsd.org/D26208
2020-12-31 19:18:20 -08:00
Xin LI
1cc908de3a Remove unused includes. 2020-12-22 21:04:36 -08:00
Mariusz Zaborski
7672a0148f Convert cap_enter() < 0 && errno != ENOSYS to caph_enter() < 0.
No functional change intended.
2018-06-19 23:43:14 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Enji Cooper
d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper
4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
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
2017-02-28 23:42:47 +00:00
Bryan Drewery
490a8aa9a1 DIRDEPS_BUILD: Update dependencies.
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2016-11-13 00:11:30 +00:00
Conrad Meyer
cd1693d3f9 Capsicumize some trivial stdio programs
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
2016-11-08 05:31:01 +00:00
Enji Cooper
430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Glen Barber
7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery
15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber
ac2875fa16 Explicitly add unmarked bin/ binaries to the runtime package.
Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate
package, which requires pre-install/post-install scripts, to be
added later.

Sponsored by:	The FreeBSD Foundation
2016-02-09 16:58:50 +00:00
Glen Barber
43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Enji Cooper
6186fd1857 Integrate bin/sleep/tests from NetBSD into atf/kyua
Sponsored by: EMC / Isilon Storage Division
2014-10-09 01:39:07 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Jilles Tjoelker
c6ef00e390 sleep: Explain in a comment why the [EINTR] check is there.
Suggested by:	eadler
2013-06-05 20:15:18 +00:00
Jilles Tjoelker
c2cfcb6063 sleep: Improve nanosleep() error handling:
* 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
2013-05-28 22:07:31 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Konstantin Belousov
67a54762a1 Document the new argument parser for sleep(1) and SIGINFO behaviour.
Remove higlight for the unportability notice.

MFC after:	3 weeks
2010-08-02 10:59:23 +00:00
Konstantin Belousov
f6e6dc63ab Simplify argument parser by using sscanf(); simplify usage() by not
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
2010-08-02 10:57:56 +00:00
Konstantin Belousov
bc9bbbe02c Deal with proper format for printing time_t.
Reported by:	ache
MFC after:	3 weeks
2010-07-31 17:41:58 +00:00
Konstantin Belousov
13d8eedae7 Report the time left for the sleep on SIGINFO.
Be stricter in the checking of interval specification.

PR:	bin/139345
MFC after:	3 weeks
2010-07-31 14:30:11 +00:00
Stefan Farfeleder
5d3e07d4ac Fix a comment.
Submitted by:	Liam J. Foy
2005-08-07 09:11:38 +00:00
Ruslan Ermilov
6fca4c7c3f Add the new standard EXIT STATUS section where appropriate.
Sort standard sections in the (documented) preferred order.
2005-01-16 16:41:59 +00:00
Warner Losh
9ddb49cbe4 /*- or .\"- or #- to begin license clauses. 2005-01-10 08:39:26 +00:00
Mark Murray
6195fb4102 Remove clause 3 from the UCB licenses.
OK'ed by:	imp, core
2004-04-06 20:06:54 +00:00
Mark Murray
fcfa4c9589 Fix warnings. This is now WARNS=9, std=c99 clean in i386.
Use return(0) for main() instead of exit(0). Makes it a
wee bit smaller.
2003-05-03 10:14:26 +00:00
David E. O'Brien
09a80d4867 Quiet warnings about copyright[]. 2003-05-01 16:58:57 +00:00
Nate Lawson
e9a4552b14 Minimal take on previous commit -- remove getopt and printf. Static size
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
2002-11-14 01:14:35 +00:00
Nate Lawson
e021938408 Back out previous commit since there is controversy about changing so much
in sleep including duping strtol(3).  Code changes also increased
dynamic size of sleep(1).
2002-11-14 00:20:58 +00:00
Nate Lawson
174005b7f0 Remove getopt and strtol dependencies, reducing size of static exe.
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>
2002-11-13 20:12:26 +00:00
David E. O'Brien
2749b14129 Consistently use FBSDID 2002-06-30 05:15:05 +00:00
Tim J. Robbins
43d088bea2 Sort sections, use Ex macro in Diagnostics section, point out that the first
example only works with csh(1).
2002-06-10 09:33:15 +00:00
Tim J. Robbins
91c0081804 Add History section. sleep appeared in v4. 2002-06-10 09:07:22 +00:00
Warner Losh
5134c3f799 o __P has been reoved
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)
	{
	...
2002-02-02 06:50:57 +00:00
David E. O'Brien
a748290789 Default to WARNS=2. Binary builds that cannot handle this must explicitly
set WARNS=0.

Reviewed by:	mike
2001-12-04 01:57:47 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00