Magellan Linux

Annotation of /trunk/mkinitrd-magellan/klibc/usr/utils/sleep.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 532 - (hide annotations) (download)
Sat Sep 1 22:45:15 2007 UTC (16 years, 9 months ago) by niro
File MIME type: text/plain
File size: 382 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd

1 niro 532 #include <stdio.h>
2     #include <stdlib.h>
3     #include <time.h>
4     #include <errno.h>
5    
6     int main(int argc, char *argv[])
7     {
8     struct timespec ts;
9     char *p;
10    
11     if (argc != 2)
12     goto err;
13    
14     p = strtotimespec(argv[1], &ts);
15     if (*p)
16     goto err;
17    
18     while (nanosleep(&ts, &ts) == -1 && errno == EINTR) ;
19    
20     return 0;
21    
22     err:
23     fprintf(stderr, "Usage: %s seconds[.fraction]\n", argv[0]);
24     return 1;
25     }