libc, libutil: remove compat hacks
[minix.git] / commands / sleep / sleep.c
blob289088f2f34f8d18a9f73ef112a238b7d6be0dbe
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 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);