mirror of
https://github.com/ziglang/zig.git
synced 2025-12-22 06:03:16 +00:00
15 lines
331 B
C
Vendored
15 lines
331 B
C
Vendored
#include <threads.h>
|
|
#include <time.h>
|
|
#include <errno.h>
|
|
#include "syscall.h"
|
|
|
|
int thrd_sleep(const struct timespec *req, struct timespec *rem)
|
|
{
|
|
int ret = -__clock_nanosleep(CLOCK_REALTIME, 0, req, rem);
|
|
switch (ret) {
|
|
case 0: return 0;
|
|
case -EINTR: return -1; /* value specified by C11 */
|
|
default: return -2;
|
|
}
|
|
}
|