xref: /original-bsd/bin/sleep/sleep.c (revision 655593d0)
1 /*
2  * Copyright (c) 1988 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 char copyright[] =
10 "@(#) Copyright (c) 1988 Regents of the University of California.\n\
11  All rights reserved.\n";
12 #endif /* not lint */
13 
14 #ifndef lint
15 static char sccsid[] = "@(#)sleep.c	5.5 (Berkeley) 04/08/91";
16 #endif /* not lint */
17 
18 #include <unistd.h>
19 #include <stdio.h>
20 #include <stdlib.h>
21 
22 main(argc, argv)
23 	int argc;
24 	char **argv;
25 {
26 	int secs;
27 
28 	if (argc != 2) {
29 		(void)fprintf(stderr, "usage: sleep time\n");
30 		exit(1);
31 	}
32 	if ((secs = atoi(argv[1])) > 0)
33 		(void)sleep(secs);
34 	exit(0);
35 }
36