5 #define IS32BIT(x) !((x)+0x80000000ULL>>32)
7 int setitimer(int which
, const struct itimerval
*restrict
new, struct itimerval
*restrict old
)
9 if (sizeof(time_t) > sizeof(long)) {
10 time_t is
= new->it_interval
.tv_sec
, vs
= new->it_value
.tv_sec
;
11 long ius
= new->it_interval
.tv_usec
, vus
= new->it_value
.tv_usec
;
12 if (!IS32BIT(is
) || !IS32BIT(vs
))
13 return __syscall_ret(-ENOTSUP
);
15 int r
= __syscall(SYS_setitimer
, which
,
16 ((long[]){is
, ius
, vs
, vus
}), old32
);
18 old
->it_interval
.tv_sec
= old32
[0];
19 old
->it_interval
.tv_usec
= old32
[1];
20 old
->it_value
.tv_sec
= old32
[2];
21 old
->it_value
.tv_usec
= old32
[3];
23 return __syscall_ret(r
);
25 return syscall(SYS_setitimer
, which
, new, old
);