Sign in
googlers
/
maze
/
klibc
/
refs/tags/klibc-1.4.23
/
.
/
usr
/
klibc
/
usleep.c
blob: 93bfabefde06f30087bc54c64b2d0f1c2a0cf7a2 [
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
)
;
}