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.
8 lines
180 B
C
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));
|
|
}
|