chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc / usleep.c
1 /*
2  * usleep.c
3  */
4
5 #include <errno.h>
6 #include <time.h>
7
8 void usleep(unsigned long usec)
9 {
10   struct timespec ts;
11
12   ts.tv_sec  = usec/1000000UL;
13   ts.tv_nsec = (usec%1000000UL) * 1000;
14   while ( nanosleep(&ts,&ts) == -1 && errno == EINTR );
15 }