Sign in
googlers
/
maze
/
klibc
/
1eb16e832fa5e2fb74c1a3cc76c0a83d06cd386e
/
.
/
usleep.c
blob: b63352eebf976b27f1aaeff12adc2adaf0820387 [
file
] [
log
] [
blame
]
/*
* usleep.c
*/
#include
<errno.h>
#include
<time.h>
void
usleep
(
unsigned
long
usec
)
{
struct
timespec ts
;
ts
.
tv_sec
=
usec
/
1000000UL
;
ts
.
tv_nsec
=
(
usec
%
1000000UL
)
*
1000
;
while
(
nanosleep
(&
ts
,&
ts
)
==
-
1
&&
errno
==
EINTR
);
}