source:
trunk/minix/lib/posix/usleep.c@
9
| Last change on this file since 9 was 9, checked in by , 15 years ago | |
|---|---|
| File size: 270 bytes | |
| Rev | Line | |
|---|---|---|
| [9] | 1 | /* |
| 2 | lib/posix/usleep.c | |
| 3 | */ | |
| 4 | ||
| 5 | #include <unistd.h> | |
| 6 | #include <sys/select.h> | |
| 7 | #include <sys/time.h> | |
| 8 | ||
| 9 | int usleep(useconds_t useconds) | |
| 10 | { | |
| 11 | int r; | |
| 12 | struct timeval tv; | |
| 13 | ||
| 14 | tv.tv_sec= useconds/1000000; | |
| 15 | tv.tv_usec= useconds % 1000000; | |
| 16 | r= select(0, NULL, NULL, NULL, &tv); | |
| 17 | return r; | |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.