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
sys/mount.h: add MS_NOSYMFOLLOW from linux v5.10
[musl.git]
/
compat
/
time32
/
clock_gettime32.c
blob
0cac7bbdf6dc1f2963e25ea0a592820eb3193ea6
1
#include
"time32.h"
2
#include <time.h>
3
#include <errno.h>
4
#include <stdint.h>
5
6
int
__clock_gettime32
(
clockid_t clk
,
struct
timespec32
*
ts32
)
7
{
8
struct
timespec ts
;
9
int
r
=
clock_gettime
(
clk
, &
ts
);
10
if
(
r
)
return
r
;
11
if
(
ts
.
tv_sec
<
INT32_MIN
||
ts
.
tv_sec
>
INT32_MAX
) {
12
errno
=
EOVERFLOW
;
13
return
-
1
;
14
}
15
ts32
->
tv_sec
=
ts
.
tv_sec
;
16
ts32
->
tv_nsec
=
ts
.
tv_nsec
;
17
return
0
;
18
}