Hi,

As you probably know, the new stable 0.9.31 uClibc release is out. One
of the changes since earlier versions is that usleep is (correctly so)
not available when UCLIBC_SUSV3_LEGACY is disabled, which it is by
default.

Now, we use usleep in quite a lot of places:

coreutils/usleep.c
libbb/lineedit.c
libbb/update_passwd.c
miscutils/beep.c
miscutils/chat.c
miscutils/flashcp.c
miscutils/watchdoc.c
modutils/modprobe-small.c
networking/ifupdown.c
networking/pscan.c
networking/traceroute.c
procps/nmeter.c
procps/top.c
runit/sv.c
util-linux/hwclock.c
util-linux/mdev.c
util-linux/rtcwake.c
util-linux/scriptreplay.c

We're supposed to use nanosleep instead, but calling that directly would
lead to some bloat because of the more complicated interface - Is there
interest in a patch adding a xusleep / bb_usleep emulation to libbb
similar to uClibc's version?

int usleep (__useconds_t usec)
{
    const struct timespec ts = {
        .tv_sec = (long int) (usec / 1000000),
        .tv_nsec = (long int) (usec % 1000000) * 1000ul
    };
    return(nanosleep(&ts, NULL));
}

-- 
Bye, Peter Korsgaard
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to