rewrite and add Berkeley specific header; atoi is in the C library
[unix-history] / usr / src / bin / sleep / sleep.c
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef lint
char copyright[] =
"@(#) Copyright (c) 1988 Regents of the University of California.\n\
All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) %G%";
#endif /* not lint */
#include <stdio.h>
main(argc, argv)
int argc;
char **argv;
{
int secs;
if (argc != 2) {
fputs("usage: sleep time\n", stderr);
exit(1);
}
if ((secs = atoi(argv[1])) > 0)
(void)sleep(secs);
exit(0);
}