tools/nolibc/unistd: add usleep()
This call is trivial to implement based on select() to complete sleep() and msleep(), let's add it. Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
4619de3446
commit
180a9797b0
|
@ -37,6 +37,14 @@ unsigned int sleep(unsigned int seconds)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __attribute__((unused))
|
||||||
|
int usleep(unsigned int usecs)
|
||||||
|
{
|
||||||
|
struct timeval my_timeval = { usecs / 1000000, usecs % 1000000 };
|
||||||
|
|
||||||
|
return sys_select(0, 0, 0, 0, &my_timeval);
|
||||||
|
}
|
||||||
|
|
||||||
static __attribute__((unused))
|
static __attribute__((unused))
|
||||||
int tcsetpgrp(int fd, pid_t pid)
|
int tcsetpgrp(int fd, pid_t pid)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue