4915
{ $as_echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5
4916
$as_echo_n "checking for wait3 that fills in rusage... " >&6; }
4917
if test "${ac_cv_func_wait3_rusage+set}" = set; then
4918
$as_echo_n "(cached) " >&6
4920
if test "$cross_compiling" = yes; then
4921
ac_cv_func_wait3_rusage=no
4923
cat >conftest.$ac_ext <<_ACEOF
4926
cat confdefs.h >>conftest.$ac_ext
4927
cat >>conftest.$ac_ext <<_ACEOF
4928
/* end confdefs.h. */
4929
$ac_includes_default
4930
#include <sys/time.h>
4931
#include <sys/resource.h>
4932
#include <sys/wait.h>
4933
/* HP-UX has wait3 but does not fill in rusage at all. */
4939
/* Use a field that we can force nonzero --
4940
voluntary context switches.
4941
For systems like NeXT and OSF/1 that don't set it,
4942
also use the system CPU time. And page faults (I/O) for Linux. */
4944
r.ru_stime.tv_sec = 0;
4945
r.ru_stime.tv_usec = 0;
4946
r.ru_majflt = r.ru_minflt = 0;
4949
case 0: /* Child. */
4950
sleep(1); /* Give up the CPU. */
4953
case -1: /* What can we do? */
4956
default: /* Parent. */
4958
/* Avoid "text file busy" from rm on fast HP-UX machines. */
4960
return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
4961
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
4965
rm -f conftest$ac_exeext
4966
if { (ac_try="$ac_link"
4968
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4969
*) ac_try_echo=$ac_try;;
4971
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4972
$as_echo "$ac_try_echo") >&5
4973
(eval "$ac_link") 2>&5
4975
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4976
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4977
{ (case "(($ac_try" in
4978
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4979
*) ac_try_echo=$ac_try;;
4981
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
4982
$as_echo "$ac_try_echo") >&5
4983
(eval "$ac_try") 2>&5
4985
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
4986
(exit $ac_status); }; }; then
4987
ac_cv_func_wait3_rusage=yes
4989
$as_echo "$as_me: program exited with status $ac_status" >&5
4990
$as_echo "$as_me: failed program was:" >&5
4991
sed 's/^/| /' conftest.$ac_ext >&5
4994
ac_cv_func_wait3_rusage=no
4996
rm -rf conftest.dSYM
4997
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5002
{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5
5003
$as_echo "$ac_cv_func_wait3_rusage" >&6; }
5004
if test $ac_cv_func_wait3_rusage = yes; then
5006
cat >>confdefs.h <<\_ACEOF
5007
#define HAVE_WAIT3 1
5012
4915
{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
5013
4916
$as_echo_n "checking for pid_t... " >&6; }
5014
4917
if test "${ac_cv_type_pid_t+set}" = set; then