Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/usleep.c
Parent Directory | Revision Log
Revision 815 -
(show annotations)
(download)
Fri Apr 24 18:32:46 2009 UTC (15 years, 1 month ago) by niro
File MIME type: text/plain
File size: 283 byte(s)
Fri Apr 24 18:32:46 2009 UTC (15 years, 1 month ago) by niro
File MIME type: text/plain
File size: 283 byte(s)
-updated to klibc-1.5.15
1 | /* |
2 | * usleep.c |
3 | */ |
4 | |
5 | #include <errno.h> |
6 | #include <stdlib.h> |
7 | #include <time.h> |
8 | #include <unistd.h> |
9 | |
10 | void usleep(unsigned long usec) |
11 | { |
12 | struct timespec ts; |
13 | |
14 | ts.tv_sec = usec / 1000000UL; |
15 | ts.tv_nsec = (usec % 1000000UL) * 1000; |
16 | while (nanosleep(&ts, &ts) == -1 && errno == EINTR) ; |
17 | } |