Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
379 bytes
|
Line | |
---|
1 | /* Copied from libc/posix/sleep.c, removed the check for HAVE_NANOSLEEP */ |
---|
2 | |
---|
3 | /* Written 2000 by Werner Almesberger */ |
---|
4 | |
---|
5 | #include <errno.h> |
---|
6 | #include <time.h> |
---|
7 | #include <unistd.h> |
---|
8 | |
---|
9 | unsigned sleep(unsigned seconds) |
---|
10 | { |
---|
11 | struct timespec ts; |
---|
12 | |
---|
13 | ts.tv_sec = seconds; |
---|
14 | ts.tv_nsec = 0; |
---|
15 | if (!nanosleep(&ts,&ts)) return 0; |
---|
16 | if (errno == EINTR) return ts.tv_sec; |
---|
17 | return -1; |
---|
18 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.