repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
powerpc-sf longjmp clobbering of val argument
[musl.git]
/
src
/
thread
/
thrd_sleep.c
blob
97de53455ede450885fcd6bdd6bb6de09b97071a
1
#include <threads.h>
2
#include <time.h>
3
#include <errno.h>
4
#include
"syscall.h"
5
6
int
thrd_sleep
(
const struct
timespec
*
req
,
struct
timespec
*
rem
)
7
{
8
int
ret
= -
__clock_nanosleep
(
CLOCK_REALTIME
,
0
,
req
,
rem
);
9
switch
(
ret
) {
10
case
0
:
return
0
;
11
case
-
EINTR
:
return
-
1
;
/* value specified by C11 */
12
default
:
return
-
2
;
13
}
14
}