thrd_sleep.c\thread\src - musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/thread/thrd_sleep.c
blob: 97de53455ede450885fcd6bdd6bb6de09b97071a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#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;
	}
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月10日 13:30:45 +0000

AltStyle によって変換されたページ (->オリジナル) /