diff options
author | Erik Troan <ewt@redhat.com> | 1997-09-16 14:12:05 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1997-09-16 14:12:05 +0000 |
commit | ced9dffda28f1ec2b060f3e419cf3c6b964b03a1 (patch) | |
tree | da3f56c24861ddc77e2910291c71adc12dca136b /src/usleep.c | |
download | initscripts-ced9dffda28f1ec2b060f3e419cf3c6b964b03a1.tar initscripts-ced9dffda28f1ec2b060f3e419cf3c6b964b03a1.tar.gz initscripts-ced9dffda28f1ec2b060f3e419cf3c6b964b03a1.tar.bz2 initscripts-ced9dffda28f1ec2b060f3e419cf3c6b964b03a1.tar.xz initscripts-ced9dffda28f1ec2b060f3e419cf3c6b964b03a1.zip |
Initial revision
Diffstat (limited to 'src/usleep.c')
-rw-r--r-- | src/usleep.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/usleep.c b/src/usleep.c new file mode 100644 index 00000000..dbffc850 --- /dev/null +++ b/src/usleep.c @@ -0,0 +1,37 @@ +/* + * usleep + * + * Written by Donald Barnes <djb@redhat.com> for Red Hat Software. + * + */ + + +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +void main(int argc, char **argv) +{ + + double count; + + if (argc == 1) count=1; + else if (!strcmp(argv[1], "--help")) + { + printf("usleep [number]\n sleep [number] of microseconds\n the default number to sleep is 1 microsecond\n"); + exit(0); + } + else if (!strcmp(argv[1], "-v")) + { + printf("usleep version 1.0 by Donald Barnes <djb@redhat.com>\n usleep --help for more info\n"); + exit(0); + } + else + count = strtod(argv[1], NULL); + + usleep(count); + exit(0); + + +} |