OLD | NEW |
1 #include <threads.h> | 1 #include <threads.h> |
2 #include <errno.h> | 2 #include <errno.h> |
3 #include "syscall.h" | 3 #include "syscall.h" |
4 | 4 |
5 int thrd_sleep(const struct timespec *req, struct timespec *rem) | 5 int thrd_sleep(const struct timespec* req, struct timespec* rem) { |
6 { | 6 int ret = __syscall(SYS_nanosleep, req, rem); |
7 » int ret = __syscall(SYS_nanosleep, req, rem); | 7 switch (ret) { |
8 » switch (ret) { | 8 case 0: |
9 » case 0: return 0; | 9 return 0; |
10 » case -EINTR: return -1; /* value specified by C11 */ | 10 case -EINTR: |
11 » default: return -2; | 11 return -1; /* value specified by C11 */ |
12 » } | 12 default: |
| 13 return -2; |
| 14 } |
13 } | 15 } |
OLD | NEW |