blob: 7052ecaa0cba35d74d47fdb698c0eaa0dfc67d85 [file] [log] [blame]
Rob Landley28964802008-01-19 17:08:39 -06001/* vi: set sw=4 ts=4:
2 *
Rob Landleyf2f98fa2007-05-17 02:38:27 -04003 * sleep.c - Wait for a number of seconds.
Rob Landleyfece5cb2007-12-03 20:05:57 -06004 *
Rob Landley28964802008-01-19 17:08:39 -06005 * Copyright 2007 Rob Landley <rob@landley.net>
6 *
Rob Landley5c67e352007-12-11 15:41:31 -06007 * See http://www.opengroup.org/onlinepubs/009695399/utilities/sleep.html
Rob Landley28964802008-01-19 17:08:39 -06008
Rob Landley55928b12008-01-19 17:43:27 -06009USE_SLEEP(NEWTOY(sleep, "<1", TOYFLAG_BIN))
10
Rob Landley28964802008-01-19 17:08:39 -060011config SLEEP
12 bool "sleep"
13 default y
14 help
15 usage: sleep SECONDS
16
17 Wait a decimal integer number of seconds.
18*/
Rob Landleyf2f98fa2007-05-17 02:38:27 -040019
20#include "toys.h"
21
Rob Landleyb1aaba12008-01-20 17:25:44 -060022DEFINE_GLOBALS(
23 long seconds;
24)
25
Rob Landleyefda21c2007-11-29 18:14:37 -060026void sleep_main(void)
Rob Landleyf2f98fa2007-05-17 02:38:27 -040027{
Rob Landleyefda21c2007-11-29 18:14:37 -060028 toys.exitval = sleep(atol(*toys.optargs));
Rob Landleyf2f98fa2007-05-17 02:38:27 -040029}