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
riscv32: add dlsym
[musl.git]
/
src
/
time
/
clock_getcpuclockid.c
blob
bce1e8ab290134e1a915c693e37fa63c536f7515
1
#include <time.h>
2
#include <errno.h>
3
#include <unistd.h>
4
#include
"syscall.h"
5
6
int
clock_getcpuclockid
(
pid_t pid
,
clockid_t
*
clk
)
7
{
8
struct
timespec ts
;
9
clockid_t id
= (-
pid
-
1
)*
8U
+
2
;
10
int
ret
=
__syscall
(
SYS_clock_getres
,
id
, &
ts
);
11
if
(
ret
== -
EINVAL
)
ret
= -
ESRCH
;
12
if
(
ret
)
return
-
ret
;
13
*
clk
=
id
;
14
return
0
;
15
}