summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/unistd/usleep.c
blob: 6c96652691e0dabacacde4885f74466d2772a661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#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);
}