xref: /csrg-svn/bin/sleep/sleep.c (revision 34660)
1*34660Sbostic /*
2*34660Sbostic  * Copyright (c) 1988 Regents of the University of California.
3*34660Sbostic  * All rights reserved.
4*34660Sbostic  *
5*34660Sbostic  * Redistribution and use in source and binary forms are permitted
6*34660Sbostic  * provided that this notice is preserved and that due credit is given
7*34660Sbostic  * to the University of California at Berkeley. The name of the University
8*34660Sbostic  * may not be used to endorse or promote products derived from this
9*34660Sbostic  * software without specific prior written permission. This software
10*34660Sbostic  * is provided ``as is'' without express or implied warranty.
11*34660Sbostic  */
12*34660Sbostic 
13*34660Sbostic #ifndef lint
14*34660Sbostic char copyright[] =
15*34660Sbostic "@(#) Copyright (c) 1988 Regents of the University of California.\n\
16*34660Sbostic  All rights reserved.\n";
17*34660Sbostic #endif /* not lint */
18*34660Sbostic 
19*34660Sbostic #ifndef lint
20*34660Sbostic static char sccsid[] = "@(#)sleep.c	5.2 (Berkeley) 06/06/88";
21*34660Sbostic #endif /* not lint */
22*34660Sbostic 
23*34660Sbostic #include <stdio.h>
24*34660Sbostic 
251093Sbill main(argc, argv)
26*34660Sbostic 	int argc;
27*34660Sbostic 	char **argv;
281093Sbill {
29*34660Sbostic 	int secs;
301093Sbill 
31*34660Sbostic 	if (argc != 2) {
32*34660Sbostic 		fputs("usage: sleep time\n", stderr);
33*34660Sbostic 		exit(1);
341093Sbill 	}
35*34660Sbostic 	if ((secs = atoi(argv[1])) > 0)
36*34660Sbostic 		(void)sleep(secs);
37*34660Sbostic 	exit(0);
381093Sbill }
39