]> granicus.if.org Git - apache/commitdiff
get threaded.c to compile on non-AIX systems which have sys/processor.h
authorJeff Trawick <trawick@apache.org>
Tue, 12 Jun 2001 12:55:22 +0000 (12:55 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 12 Jun 2001 12:55:22 +0000 (12:55 +0000)
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

configure.in
server/mpm/threaded/threaded.c

index 7fc78373b74968eb7157f46cb1743c98e9d9ce77..ffad43ec48eb05306ce00a03785d80e7da196f07 100644 (file)
@@ -201,6 +201,7 @@ dnl See Comment #Spoon
 
 AC_CHECK_FUNCS( \
 initgroups \
+bindprocessor \
 )
 
 AC_CHECK_LIB(nsl, gethostbyname)
index c33113ba0ab2b0dfd2858160fc8ed902ef58648b..30ca06463d67a75aaeb01e4e231cf5a6a1c6b239 100644 (file)
@@ -72,6 +72,9 @@
 #if APR_HAVE_SYS_WAIT_H
 #include <sys/wait.h> 
 #endif
+#ifdef HAVE_SYS_PROCESSOR_H
+#include <sys/processor.h> /* 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 <sys/processor.h>
+#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);