ubuntu-buildroot/output/build/host-gawk-5.2.0/missing_d/usleep.c

18 lines
343 B
C
Raw Normal View History

2024-04-01 15:19:46 +00:00
/*
* usleep - round microseconds up to an integral number of seconds.
*
* The real usleep() doesn't work this way; this is a hack for systems
* that don't have usleep().
*/
int
usleep(unsigned int usec)
{
unsigned int seconds = usec / 1000000;
/* Round up: */
seconds += (usec % 1000000 > 0); /* 1 or 0 */
return sleep(seconds);
}