From: Kurt Zeilenga Date: Sat, 23 Jan 1999 04:03:43 +0000 (+0000) Subject: Remove configure's wait3 test as we don't care about the rusage. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~712 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4863d98084d150cef8a8cd4a3094576fdfebe641;p=openldap Remove configure's wait3 test as we don't care about the rusage. Rewrite all child waits to use wait4 (for consistency only). --- diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index ef624e0430..47f127d939 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -325,10 +325,10 @@ wait4child( int sig ) if ( debug ) printf( "parent: catching child status\n" ); #ifdef HAVE_WAITPID - while (waitpid ((pid_t) -1, 0, WAIT_FLAGS) > 0) + while (waitpid ((pid_t) -1, (int *) NULL, WAIT_FLAGS) > 0) ; /* NULL */ #else - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + while ( wait4((pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 ) ; /* NULL */ #endif diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index d2218f537b..4735947c0e 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -352,10 +352,10 @@ wait4child( int sig ) if ( debug ) printf( "parent: catching child status\n" ); #ifdef HAVE_WAITPID - while (waitpid ((pid_t) -1, NULL, WAIT_FLAGS) > 0) + while (waitpid ((pid_t) -1, (int *) NULL, WAIT_FLAGS) > 0) ; /* NULL */ #else - while (wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + while (wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 ) ; /* NULL */ #endif diff --git a/configure b/configure index 7ca2ef8090..6a39cb4249 100755 --- a/configure +++ b/configure @@ -8338,69 +8338,6 @@ done fi -echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:8343: checking for wait3 that fills in rusage" >&5 -if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_wait3_rusage=no -else - cat > conftest.$ac_ext < -#include -#include -#include -/* HP-UX has wait3 but does not fill in rusage at all. */ -main() { - struct rusage r; - int i; - /* Use a field that we can force nonzero -- - voluntary context switches. - For systems like NeXT and OSF/1 that don't set it, - also use the system CPU time. And page faults (I/O) for Linux. */ - r.ru_nvcsw = 0; - r.ru_stime.tv_sec = 0; - r.ru_stime.tv_usec = 0; - r.ru_majflt = r.ru_minflt = 0; - switch (fork()) { - case 0: /* Child. */ - sleep(1); /* Give up the CPU. */ - _exit(0); - case -1: _exit(0); /* What can we do? */ - default: /* Parent. */ - wait3(&i, 0, &r); - sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */ - exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 - && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); - } -} -EOF -if { (eval echo configure:8382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null -then - ac_cv_func_wait3_rusage=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_wait3_rusage=no -fi -rm -fr conftest* -fi - -fi - -echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6 -if test $ac_cv_func_wait3_rusage = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_WAIT3 1 -EOF - -fi - - for ac_func in \ bcopy \ flock \ @@ -8434,12 +8371,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8438: checking for $ac_func" >&5 +echo "configure:8375: 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; then +if { (eval echo configure:8403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8496,12 +8433,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8500: checking for $ac_func" >&5 +echo "configure:8437: 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; then +if { (eval echo configure:8465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8551,19 +8488,19 @@ done if test "$ac_cv_func_ctime_r" = yes ; then echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6 -echo "configure:8555: checking number of arguments of ctime_r" >&5 +echo "configure:8492: checking number of arguments of ctime_r" >&5 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { time_t ti; char *buffer; ctime_r(&ti,buffer,32); ; return 0; } EOF -if { (eval echo configure:8567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_ctime_r_nargs=3 else @@ -8575,7 +8512,7 @@ fi rm -f conftest* if test $ol_cv_func_ctime_r_nargs = 0 ; then cat > conftest.$ac_ext < int main() { @@ -8583,7 +8520,7 @@ time_t ti; char *buffer; ctime_r(&ti,buffer); ; return 0; } EOF -if { (eval echo configure:8587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_func_ctime_r_nargs=2 else @@ -8632,12 +8569,12 @@ fi for ac_func in getopt tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8636: checking for $ac_func" >&5 +echo "configure:8573: 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; then +if { (eval echo configure:8601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8690,13 +8627,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:8694: checking declaration of sys_errlist" >&5 +echo "configure:8631: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -8706,7 +8643,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -8727,20 +8664,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:8731: checking existence of sys_errlist" >&5 +echo "configure:8668: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index d1dad6f652..66504d6e58 100644 --- a/configure.in +++ b/configure.in @@ -1278,8 +1278,6 @@ if test $ac_cv_func_vprintf = yes ; then AC_CHECK_FUNCS(vsnprintf vsprintf) fi -AC_FUNC_WAIT3 - AC_CHECK_FUNCS( \ bcopy \ flock \ diff --git a/include/portable.h.in b/include/portable.h.in index 696ded0c02..1732e0f7b9 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -47,9 +47,6 @@ /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF -/* Define if you have the wait3 system call. */ -#undef HAVE_WAIT3 - /* Define if on MINIX. */ #undef _MINIX diff --git a/servers/ldapd/main.c b/servers/ldapd/main.c index 3542146091..85f9b5d71f 100644 --- a/servers/ldapd/main.c +++ b/servers/ldapd/main.c @@ -653,10 +653,10 @@ wait4child( int sig ) Debug( LDAP_DEBUG_TRACE, "parent: catching child status\n", 0, 0, 0 ); #ifdef HAVE_WAITPID - while( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) > 0 ) + while( waitpid( (pid_t) -1, (int *) NULL, WAIT_FLAGS ) > 0 ) ; /* NULL */ #else - while ( wait3( &status, WAIT_FLAGS, 0 ) > 0 ) + while ( wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) > 0 ) ; /* NULL */ #endif diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 598e4a11c4..31d43491ae 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -537,7 +537,7 @@ edit_entry( char c, Datum *data ) #ifdef HAVE_WAITPID if ( waitpid( (pid_t) -1, NULL, WAIT_FLAGS ) < 0 ) { #else - if ( wait3( &status, WAIT_FLAGS, 0 ) < 0 ) { + if ( wait4( (pid_t) -1, &status, WAIT_FLAGS, 0 ) < 0 ) { #endif perror( "wait" ); return;