AC_DEFUN([gt_UNION_WAIT],
[
AC_CHECK_FUNCS(waitpid)
AC_MSG_CHECKING(for union wait)
AC_CACHE_VAL(gt_cv_union_wait, [AC_TRY_LINK([ [union wait status; int pid; pid = wait (&status);
/* Some POSIXoid systems have both the new-style macros and the old
union wait type, and they do not work together. If union wait
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
if (WEXITSTATUS (status) != 0) pid = -1;
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
-- blow chunks here --
/* Make sure union wait works with waitpid. */
pid = waitpid (-1, &status, 0);
],
[gt_cv_union_wait=yes], [gt_cv_union_wait=no])])
if test "$gt_cv_union_wait" = yes; then
AC_DEFINE(HAVE_UNION_WAIT, 1,
[Define if <sys/wait.h> defines the 'union wait' type.])
fi
AC_MSG_RESULT($gt_cv_union_wait)
])