diff --git a/configure b/configure index ff81b5d1c0..696bf4a3ca 100755 --- a/configure +++ b/configure @@ -1515,7 +1515,7 @@ EOF fi -for ac_hdr in fcntl.h malloc.h strings.h sys/time.h unistd.h sys/systeminfo.h sys/resource.h sys/types.h dirent.h sys/utsname.h netdb.h netinet/in.h arpa/inet.h signal.h sys/wait.h +for ac_hdr in fcntl.h malloc.h strings.h sys/time.h unistd.h sys/systeminfo.h sys/resource.h sys/types.h dirent.h sys/utsname.h netdb.h netinet/in.h arpa/inet.h signal.h sys/wait.h sys/file.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1888,6 +1888,8 @@ main() { r.ru_majflt = r.ru_minflt = 0; switch (fork()) { case 0: /* Child. */ + /* Unless we actually _do_ something, the kernel sometimes doesn't chalk up any system time to this process. */ + if(fork()) { i = 123; wait(NULL); } else { i = 234; exit(0); } sleep(1); /* Give up the CPU. */ _exit(0); case -1: _exit(0); /* What can we do? */ @@ -1899,7 +1901,7 @@ main() { } } EOF -if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -1924,12 +1926,12 @@ fi for ac_func in gethostname gettimeofday mkdir select socket strstr uname lockf flock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1928: checking for $ac_func" >&5 +echo "configure:1930: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else diff --git a/configure.in b/configure.in index 738237ca1b..930cf2ed2c 100644 --- a/configure.in +++ b/configure.in @@ -29,7 +29,7 @@ dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h malloc.h strings.h sys/time.h unistd.h sys/systeminfo.h sys/resource.h sys/types.h dirent.h sys/utsname.h netdb.h netinet/in.h arpa/inet.h signal.h sys/wait.h) +AC_CHECK_HEADERS(fcntl.h malloc.h strings.h sys/time.h unistd.h sys/systeminfo.h sys/resource.h sys/types.h dirent.h sys/utsname.h netdb.h netinet/in.h arpa/inet.h signal.h sys/wait.h sys/file.h) AC_CHECK_HEADERS(mysql/include/mysql_com.h mysql/mysql_com.h) dnl Checks for typedefs, structures, and compiler characteristics. diff --git a/lib/util.C b/lib/util.C index fd67aca82f..981a07b880 100755 --- a/lib/util.C +++ b/lib/util.C @@ -24,7 +24,9 @@ #include #include #include +#ifdef HAVE_SYS_FILE_H #include +#endif #ifdef _WIN32 #include