1 dnl *********** BSD vs. POSIX signal handling **************
2 AC_DEFUN([AC_BSD_SIGNALS], [
3 AC_MSG_CHECKING(for BSD signal semantics)
4 AC_CACHE_VAL(knfsd_cv_bsd_signals,
10 static int counter = 0;
11 static RETSIGTYPE handler(int num) { counter++; }
16 if ((s = fork()) < 0) return 1;
18 if (wait(&s) < 0) return 1;
19 return WIFSIGNALED(s)? 1 : 0;
22 signal(SIGHUP, handler);
23 kill(getpid(), SIGHUP); kill(getpid(), SIGHUP);
24 return (counter == 2)? 0 : 1;
26 ], knfsd_cv_bsd_signals=yes, knfsd_cv_bsd_signals=no,
29 *linux*) knfsd_cv_bsd_signals=no;;
30 *bsd*) knfsd_cv_bsd_signals=yes;;
31 *) AC_MSG_ERROR([unable to guess signal semantics for $host_os; please set knfsd_cv_bsd_signals]);;
34 AC_MSG_RESULT($knfsd_cv_bsd_signals)
35 test $knfsd_cv_bsd_signals = yes && AC_DEFINE(HAVE_BSD_SIGNALS, 1, [Define this if you want to use BSD signal semantics])