aboutsummaryrefslogtreecommitdiff
path: root/src/unistd/sleep.c
blob: b4d68c639d807a15726a3382db4e207e86c35dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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;
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif