From: Jeff Trawick Date: Tue, 12 Jun 2001 12:55:22 +0000 (+0000) Subject: get threaded.c to compile on non-AIX systems which have sys/processor.h X-Git-Tag: 2.0.19~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=405d7ea1f5990371945857d5712865f7fb078b8a;p=apache get threaded.c to compile on non-AIX systems which have sys/processor.h if we want to call bindprocessor(), we should check for bindprocessor(), not some header file (prefork and perchild to be fixed shortly) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89351 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/configure.in b/configure.in index 7fc78373b7..ffad43ec48 100644 --- a/configure.in +++ b/configure.in @@ -201,6 +201,7 @@ dnl See Comment #Spoon AC_CHECK_FUNCS( \ initgroups \ +bindprocessor \ ) AC_CHECK_LIB(nsl, gethostbyname) diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c index c33113ba0a..30ca06463d 100644 --- a/server/mpm/threaded/threaded.c +++ b/server/mpm/threaded/threaded.c @@ -72,6 +72,9 @@ #if APR_HAVE_SYS_WAIT_H #include #endif +#ifdef HAVE_SYS_PROCESSOR_H +#include /* for bindprocessor() */ +#endif #if !APR_HAS_THREADS #error The threaded MPM requires APR threads, but they are unavailable. @@ -803,18 +806,16 @@ static int make_child(server_rec *s, int slot) } if (!pid) { -#ifdef HAVE_SYS_PROCESSOR_H - /* By default, AIX binds to a single processor. This bit unbinds - children which will then bind to another CPU. - */ -#include +#ifdef HAVE_BINDPROCESSOR + /* By default, AIX binds to a single processor. This bit unbinds + * children which will then bind to another CPU. + */ int status = bindprocessor(BINDPROCESS, (int)getpid(), PROCESSOR_CLASS_ANY); if (status != OK) ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, errno, ap_server_conf, "processor unbind failed %d", status); #endif - RAISE_SIGSTOP(MAKE_CHILD); apr_signal(SIGTERM, just_die);