2011-05-23 14:00:31 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <unistd.h>
|
2014-11-13 12:29:30 -05:00
|
|
|
|
2011-05-23 14:00:31 -04:00
|
|
|
#include "util.h"
|
|
|
|
|
2013-06-14 14:20:47 -04:00
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
2015-01-30 07:41:36 -05:00
|
|
|
eprintf("usage: %s num\n", argv0);
|
2013-06-14 14:20:47 -04:00
|
|
|
}
|
|
|
|
|
2011-05-23 14:00:31 -04:00
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
2015-02-28 14:10:25 -05:00
|
|
|
unsigned seconds;
|
2011-05-23 14:00:31 -04:00
|
|
|
|
2017-08-05 17:50:39 -04:00
|
|
|
argv0 = *argv, argv0 ? (argc--, argv++) : (void *)0;
|
2011-05-23 14:00:31 -04:00
|
|
|
|
2015-02-28 14:10:25 -05:00
|
|
|
if (argc != 1)
|
2013-06-14 14:20:47 -04:00
|
|
|
usage();
|
|
|
|
|
2015-01-30 09:01:45 -05:00
|
|
|
seconds = estrtonum(argv[0], 0, UINT_MAX);
|
2014-11-13 12:29:30 -05:00
|
|
|
while ((seconds = sleep(seconds)) > 0)
|
2011-05-23 14:00:31 -04:00
|
|
|
;
|
2015-02-28 14:10:25 -05:00
|
|
|
|
2014-10-02 18:46:04 -04:00
|
|
|
return 0;
|
2011-05-23 14:00:31 -04:00
|
|
|
}
|