From ad491ceec6145b3781a05dc7b4a36052abeeb4b4 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 31 Oct 2016 12:20:33 +0100 Subject: common: New function gnupg_usleep. * configure.ac (HAVE_NANOSLEEP): Test for nanosleep. * common/sysutils.c: Always include time.h. (gnupg_usleep): New. -- This function has been compiled from nPth and Libassuan. Signed-off-by: Werner Koch --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 91ef5c964..c211979b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1387,6 +1387,16 @@ AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol \ flockfile funlockfile getpwnam getpwuid \ getenv inet_pton strpbrk]) +# On some systems (e.g. Solaris) nanosleep requires linking to librl. +# Given that we use nanosleep only as an optimization over a select +# based wait function we want it only if it is available in libc. +_save_libs="$LIBS" +AC_SEARCH_LIBS([nanosleep], [], + [AC_DEFINE(HAVE_NANOSLEEP,1, + [Define to 1 if you have the `nanosleep' function in libc.])]) +LIBS="$_save_libs" + + # See whether libc supports the Linux inotify interface case "${host}" in *-*-linux*) -- cgit v1.2.3