From ad16741ccd8a8587644d88fb8fdfc41ada1928a6 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 13 Apr 2014 16:37:57 +0200 Subject: libbb: provide usleep() fallback implementation POSIX.1-2008 removed the usleep function, provide a fallback implementaion using the recommended nanosleep(). Signed-off-by: Bernhard Reutner-Fischer Signed-off-by: Denys Vlasenko --- include/platform.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/platform.h b/include/platform.h index bd11ad69a..92f775551 100644 --- a/include/platform.h +++ b/include/platform.h @@ -373,6 +373,7 @@ typedef unsigned smalluint; #define HAVE_STRSIGNAL 1 #define HAVE_STRVERSCMP 1 #define HAVE_VASPRINTF 1 +#define HAVE_USLEEP 1 #define HAVE_UNLOCKED_STDIO 1 #define HAVE_UNLOCKED_LINE_OPS 1 #define HAVE_GETLINE 1 @@ -381,8 +382,15 @@ typedef unsigned smalluint; #define HAVE_NET_ETHERNET_H 1 #define HAVE_SYS_STATFS_H 1 -#if defined(__UCLIBC__) && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32) -# undef HAVE_STRVERSCMP +#if defined(__UCLIBC__) +# if UCLIBC_VERSION < KERNEL_VERSION(0, 9, 32) +# undef HAVE_STRVERSCMP +# endif +# if UCLIBC_VERSION >= KERNEL_VERSION(0, 9, 30) +# ifndef __UCLIBC_SUSV3_LEGACY__ +# undef HAVE_USLEEP +# endif +# endif #endif #if defined(__WATCOMC__) @@ -519,6 +527,10 @@ extern char *strsep(char **stringp, const char *delim) FAST_FUNC; # define strsignal(sig) get_signame(sig) #endif +#ifndef HAVE_USLEEP +extern int usleep(unsigned) FAST_FUNC; +#endif + #ifndef HAVE_VASPRINTF extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC; #endif -- cgit v1.2.3