sleep.c\unistd\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/unistd/sleep.c
blob: d64509413e54b5f408a6285ad527d3977cb46556 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#include <unistd.h>
#include <time.h>
unsigned sleep(unsigned seconds)
{
	struct timespec tv = { .tv_sec = seconds, .tv_nsec = 0 };
	if (nanosleep(&tv, &tv))
		return tv.tv_sec;
	return 0;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月07日 10:43:03 +0000

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