Commit aca97e08 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

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
parent 04c7f358
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -201,6 +201,7 @@ dnl See Comment #Spoon

AC_CHECK_FUNCS( \
initgroups \
bindprocessor \
)

AC_CHECK_LIB(nsl, gethostbyname)
+7 −6
Original line number Diff line number Diff line
@@ -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
#ifdef HAVE_BINDPROCESSOR
        /* By default, AIX binds to a single processor.  This bit unbinds
	 children which will then bind to another CPU.
	 * children which will then bind to another CPU.
         */
#include <sys/processor.h>
        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);