5 #define IS32BIT(x) !((x)+0x80000000ULL>>32)
7 int clock_settime(clockid_t clk
, const struct timespec
*ts
)
9 #ifdef SYS_clock_settime64
10 time_t s
= ts
->tv_sec
;
11 long ns
= ts
->tv_nsec
;
13 if (SYS_clock_settime
== SYS_clock_settime64
|| !IS32BIT(s
))
14 r
= __syscall(SYS_clock_settime64
, clk
,
15 ((long long[]){s
, ns
}));
16 if (SYS_clock_settime
== SYS_clock_settime64
|| r
!=-ENOSYS
)
17 return __syscall_ret(r
);
19 return __syscall_ret(-ENOTSUP
);
20 return syscall(SYS_clock_settime
, clk
, ((long[]){s
, ns
}));
22 return syscall(SYS_clock_settime
, clk
, ts
);