summaryrefslogtreecommitdiff
path: root/gnulib-m4/nanosleep.m4
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2022-12-08 17:35:13 +0100
committerJörg Frings-Fürst <debian@jff.email>2022-12-08 17:35:13 +0100
commit1b1ad4ed2919fbc68d8905cfec38a968821ce372 (patch)
tree5532a7e21342f88f4df7cd42139e012b6bd1dbe6 /gnulib-m4/nanosleep.m4
parent63b5c0db2dc641876e58d232220c7efc2b2c2423 (diff)
parentfa82e850f8d894ae4b9cd75bd12ffeeb65974d50 (diff)
Merge branch 'release/debian/1.1-1_experimental1'debian/1.1-1_experimental1
Diffstat (limited to 'gnulib-m4/nanosleep.m4')
-rw-r--r--gnulib-m4/nanosleep.m439
1 files changed, 12 insertions, 27 deletions
diff --git a/gnulib-m4/nanosleep.m4 b/gnulib-m4/nanosleep.m4
index 6a51f28..dfe21f5 100644
--- a/gnulib-m4/nanosleep.m4
+++ b/gnulib-m4/nanosleep.m4
@@ -1,4 +1,4 @@
-# serial 40
+# serial 42
dnl From Jim Meyering.
dnl Check for the nanosleep function.
@@ -19,9 +19,6 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
dnl Persuade glibc and Solaris <time.h> to declare nanosleep.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_HEADERS_ONCE([sys/time.h])
- AC_REQUIRE([gl_FUNC_SELECT])
-
AC_CHECK_DECLS_ONCE([alarm])
nanosleep_save_libs=$LIBS
@@ -53,9 +50,6 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
#include <errno.h>
#include <limits.h>
#include <signal.h>
- #if HAVE_SYS_TIME_H
- #include <sys/time.h>
- #endif
#include <time.h>
#include <unistd.h>
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
@@ -106,15 +100,22 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
#else /* A simpler test for native Windows. */
if (nanosleep (&ts_sleep, &ts_remaining) < 0)
return 3;
+ /* Test for 32-bit mingw bug: negative nanosecond values do not
+ cause failure. */
+ ts_sleep.tv_sec = 1;
+ ts_sleep.tv_nsec = -1;
+ if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+ return 7;
#endif
return 0;
}]])],
[gl_cv_func_nanosleep=yes],
- [case $? in dnl (
- 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl (
- *) gl_cv_func_nanosleep=no;;
+ [case $? in
+ 4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)' ;;
+ 7) gl_cv_func_nanosleep='no (mishandles negative tv_nsec)' ;;
+ *) gl_cv_func_nanosleep=no ;;
esac],
- [case "$host_os" in dnl ((
+ [case "$host_os" in
linux*) # Guess it halfway works when the kernel is Linux.
gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
mingw*) # Guess no on native Windows.
@@ -135,15 +136,6 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1],
[Define to 1 if nanosleep mishandles large arguments.])
;;
- *)
- # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
- for ac_lib in $LIBSOCKET; do
- case " $LIB_NANOSLEEP " in
- *" $ac_lib "*) ;;
- *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
- esac
- done
- ;;
esac
;;
esac
@@ -152,10 +144,3 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
fi
LIBS=$nanosleep_save_libs
])
-
-# Prerequisites of lib/nanosleep.c.
-AC_DEFUN([gl_PREREQ_NANOSLEEP],
-[
- AC_CHECK_HEADERS_ONCE([sys/select.h])
- gl_PREREQ_SIG_HANDLER_H
-])