Files
semi-libc/src/time/nanosleep.c
T
Rich Felker 331993e3fc refactor thrd_sleep and nanosleep in terms of clock_nanosleep
for namespace-safety with thrd_sleep, this requires an alias, which is
also added. this eliminates all but one direct call point for
nanosleep syscalls, and arranges that 64-bit time_t conversion logic
will only need to exist in one file rather than three.

as a bonus, clock_nanosleep with CLOCK_REALTIME and empty flags is now
implemented as SYS_nanosleep, thereby working on older kernels that
may lack POSIX clocks functionality.
2019-07-27 02:46:57 -04:00

8 lines
180 B
C

#include <time.h>
#include "syscall.h"
int nanosleep(const struct timespec *req, struct timespec *rem)
{
return __syscall_ret(-__clock_nanosleep(CLOCK_REALTIME, 0, req, rem));
}