setlocale setmode open64 lseek64 mkstemp64 mtrace va_copy __va_copy \
seteuid strerror putenv iconv_open locale_charset nl_langinfo getxattr \
extattr_get_link sigaction sigprocmask setattrlist getgrouplist \
- initgroups utimensat posix_fallocate attropen setvbuf usleep)
+ initgroups utimensat posix_fallocate attropen setvbuf nanosleep usleep)
dnl cygwin iconv.h defines iconv_open as libiconv_open
if test x"$ac_cv_func_iconv_open" != x"yes"; then
/**
* Sleep for a specified number of milliseconds.
*
- * Always returns TRUE. (In the future it might return FALSE if
- * interrupted.)
+ * Always returns True.
**/
int msleep(int t)
{
-#ifdef HAVE_USLEEP
+#ifdef HAVE_NANOSLEEP
+ struct timespec ts;
+
+ ts.tv_sec = t / 1000;
+ ts.tv_nsec = (t % 1000) * 1000000L;
+
+ while (nanosleep(&ts, &ts) < 0 && errno == EINTR) {}
+
+#elif defined HAVE_USLEEP
usleep(t*1000);
+
#else
int tdiff = 0;
struct timeval tval, t1, t2;