forget difference between big and small commands - obsolete with vm.
[minix.git] / commands / simple / sleep.c
blobc1e0d121f58c0e7c788de0253b35df46679c54ca
1 /* sleep - suspend a process for x sec Author: Andy Tanenbaum */
3 #include <sys/types.h>
4 #include <stdlib.h>
5 #include <unistd.h>
6 #include <minix/minlib.h>
8 _PROTOTYPE(int main, (int argc, char **argv));
10 int main(argc, argv)
11 int argc;
12 char *argv[];
14 register seconds;
15 register char c;
17 seconds = 0;
19 if (argc != 2) {
20 std_err("Usage: sleep time\n");
21 exit(1);
23 while (c = *(argv[1])++) {
24 if (c < '0' || c > '9') {
25 std_err("sleep: bad arg\n");
26 exit(1);
28 seconds = 10 * seconds + (c - '0');
31 /* Now sleep. */
32 sleep(seconds);
33 return(0);