aboutsummaryrefslogtreecommitdiff
path: root/src/unistd/usleep.c
blob: d9d29481d4d0b1495d05c9be89bb047416673145 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#define _GNU_SOURCE
#include <unistd.h>
#include <time.h>

int usleep(unsigned useconds)
{
	struct timespec tv = {
		.tv_sec = useconds/1000000,
		.tv_nsec = (useconds%1000000)*1000
	};
	return nanosleep(&tv, &tv);
}


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