-for ac_func in sigwait sigwaitinfo nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam
+for ac_func in nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
ac_fn_c_check_func "$LINENO" "sigwaitinfo" "ac_cv_func_sigwaitinfo"
if test "x$ac_cv_func_sigwaitinfo" = xyes; then :
+ $as_echo "#define HAVE_SIGWAITINFO 1" >>confdefs.h
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwaitinfo in -lrt" >&5
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigwaitinfo in -lrt" >&5
$as_echo_n "checking for sigwaitinfo in -lrt... " >&6; }
if ${ac_cv_lib_rt_sigwaitinfo+:} false; then :
$as_echo_n "(cached) " >&6
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sigwaitinfo" >&5
$as_echo "$ac_cv_lib_rt_sigwaitinfo" >&6; }
if test "x$ac_cv_lib_rt_sigwaitinfo" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRT 1
+
+
+$as_echo "#define HAVE_SIGWAITINFO 1" >>confdefs.h
+
+
+fi
+
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sigwait has 2 arguments" >&5
+$as_echo_n "checking whether sigwait has 2 arguments... " >&6; }
+if ${ac_cv_libc_sigwait+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #define _POSIX_PTHREAD_SEMANTICS
+ #include <stdio.h>
+ #include <signal.h>
+int
+main ()
+{
+sigset_t sigs; int signo; sigwait(&sigs, &signo);
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
- LIBS="-lrt $LIBS"
+$as_echo "#define HAVE_SIGWAIT 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libc_sigwait" >&5
+$as_echo "$ac_cv_libc_sigwait" >&6; }
dnl for each function found we get a definition in config.h
dnl of the form HAVE_FUNCTION
-AC_CHECK_FUNCS(sigwait sigwaitinfo nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam)
+AC_CHECK_FUNCS(nl_langinfo tzset fsync mbstowcs opendir readdir chdir chroot getgid getuid setgid setuid strndup strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday getpwnam getgrnam)
AC_FUNC_STRERROR_R
GC_TIMEZONE()
dnl Solaris has sigwaitinfo in librt
-AC_CHECK_FUNC(sigwaitinfo, , AC_CHECK_LIB(rt, sigwaitinfo))
+AC_CHECK_FUNC(sigwaitinfo, AC_DEFINE(HAVE_SIGWAITINFO),[
+ AC_CHECK_LIB(rt, sigwaitinfo, [
+ AC_DEFINE(HAVE_SIGWAITINFO,[1],[have sigwaitinfo in librt])
+ ])
+])
+
+AC_CACHE_CHECK(whether sigwait has 2 arguments,
+ ac_cv_libc_sigwait,
+ AC_TRY_COMPILE([
+ #define _POSIX_PTHREAD_SEMANTICS
+ #include <stdio.h>
+ #include <signal.h>],
+ [sigset_t sigs; int signo; sigwait(&sigs, &signo);],
+ AC_DEFINE(HAVE_SIGWAIT,1,[have two argument posix sigwait])
+ AC_MSG_RESULT(yes)
+ ,
+ AC_MSG_RESULT(no)
+ )
+)
+
CHECK_FOR_WORKING_MS_ASYNC
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
-/* Define to 1 if you have the `rt' library (-lrt). */
-#undef HAVE_LIBRT
-
/* have got libwrap installed */
#undef HAVE_LIBWRAP
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
-/* Define to 1 if you have the `sigwait' function. */
+/* have two argument posix sigwait */
#undef HAVE_SIGWAIT
-/* Define to 1 if you have the `sigwaitinfo' function. */
+/* have sigwaitinfo in librt */
#undef HAVE_SIGWAITINFO
/* Define to 1 if you have the `snprintf' function. */
while (1)
{
-#ifdef HAVE_SIGWAITINFO
+#if defined(HAVE_SIGWAITINFO)
status = sigwaitinfo(&signal_set, &signal_info);
-#else
+#elif defined(HAVE_SIGWAIT)
status = -1;
if (sigwait(signal_set, &status) < 0 ){
status = -1;
}
+#else
+#error "we need sigwaitinfo or sigwait to compile rrd_daemon"
#endif
+
switch(status)
{
case -1: