mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 00:20:52 -05:00
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
1 changed files with 8 additions and 0 deletions
|
@ -37,6 +37,14 @@ unsigned int sleep(unsigned int seconds)
|
|||
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))
|
||||
int tcsetpgrp(int fd, pid_t pid)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue