uuprog
view sleep.c @ 0:4f628556fa3e
uuprog initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 25 Aug 2011 08:53:01 +0300 |
parents | |
children |
line source
1 /*! cc -o sleep sleep.c */
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <ctype.h>
5 #include <unistd.h>
7 int main(int argc, char **argv)
8 {
9 if(argc < 2) {
10 puts("seconds argument missing...");
11 return 1;
12 }
13 if(!isdigit(argv[1][0])) {
14 fprintf(stderr, "invalid argument: %s\n", argv[1]);
15 return 1;
16 }
18 sleep(atoi(argv[1]));
19 return 0;
20 }