From: Jeff Trawick Date: Mon, 13 Aug 2001 15:44:00 +0000 (+0000) Subject: allow non-Unix MPMs to use mpm_common.c by not automatically X-Git-Tag: 2.0.24~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f770a03df048eaaf297c2a2384c1c912f7d5405;p=apache allow non-Unix MPMs to use mpm_common.c by not automatically building in Unix-specific code git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90137 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/configure.in b/configure.in index 769df57f20..9ba565f5b5 100644 --- a/configure.in +++ b/configure.in @@ -202,6 +202,8 @@ dnl ## Check for library functions dnl See Comment #Spoon AC_CHECK_FUNCS( \ +getpwnam \ +getgrnam \ initgroups \ bindprocessor \ ) diff --git a/include/mpm_common.h b/include/mpm_common.h index 7c246d4085..35ac57c9ae 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -124,7 +124,9 @@ void ap_reclaim_child_processes(int terminate); * @param ret The process id of the process that died * @param p The pool to allocate out of */ +#ifdef AP_MPM_WANT_WAIT_OR_TIMEOUT void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p); +#endif /** * Log why a child died to the error log, if the child died without the @@ -132,7 +134,9 @@ void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p); * @param pid The child that has died * @param status The status returned from ap_wait_or_timeout */ +#ifdef AP_MPM_WANT_PROCESS_CHILD_STATUS void ap_process_child_status(apr_proc_t *pid, apr_wait_t status); +#endif #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) /** @@ -154,6 +158,7 @@ void ap_sock_disable_nagle(apr_socket_t *s); * @deffunc uid_t ap_uname2id(const char *name) */ AP_DECLARE(uid_t) ap_uname2id(const char *name); + /** * Convert a group name to a numeric ID * @param name The name to convert diff --git a/server/mpm/beos/mpm.h b/server/mpm/beos/mpm.h index 98e31d5b91..bdeb82ef8f 100644 --- a/server/mpm/beos/mpm.h +++ b/server/mpm/beos/mpm.h @@ -68,6 +68,8 @@ #define MPM_CHILD_PID(i) (ap_scoreboard_image->servers[0][i].tid) #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0) +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_MAX_REQUESTS diff --git a/server/mpm/experimental/perchild/mpm.h b/server/mpm/experimental/perchild/mpm.h index cdaa46e372..0a8df316b9 100644 --- a/server/mpm/experimental/perchild/mpm.h +++ b/server/mpm/experimental/perchild/mpm.h @@ -67,6 +67,8 @@ #define MPM_NAME "Perchild" +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_LOCKFILE diff --git a/server/mpm/perchild/mpm.h b/server/mpm/perchild/mpm.h index cdaa46e372..0a8df316b9 100644 --- a/server/mpm/perchild/mpm.h +++ b/server/mpm/perchild/mpm.h @@ -67,6 +67,8 @@ #define MPM_NAME "Perchild" +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_LOCKFILE diff --git a/server/mpm/prefork/mpm.h b/server/mpm/prefork/mpm.h index 429c61f1cb..5dbac99c42 100644 --- a/server/mpm/prefork/mpm.h +++ b/server/mpm/prefork/mpm.h @@ -68,6 +68,8 @@ #define MPM_NAME "Prefork" +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_LOCKFILE diff --git a/server/mpm/threaded/mpm.h b/server/mpm/threaded/mpm.h index 3c58c70836..49d01ecb7f 100644 --- a/server/mpm/threaded/mpm.h +++ b/server/mpm/threaded/mpm.h @@ -65,6 +65,8 @@ #define MPM_NAME "Threaded" +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_LOCKFILE diff --git a/server/mpm/worker/mpm.h b/server/mpm/worker/mpm.h index 8611da0912..571a00cc2b 100644 --- a/server/mpm/worker/mpm.h +++ b/server/mpm/worker/mpm.h @@ -65,6 +65,8 @@ #define MPM_NAME "Worker" +#define AP_MPM_WANT_WAIT_OR_TIMEOUT +#define AP_MPM_WANT_PROCESS_CHILD_STATUS #define AP_MPM_WANT_SET_PIDFILE #define AP_MPM_WANT_SET_SCOREBOARD #define AP_MPM_WANT_SET_LOCKFILE diff --git a/server/mpm_common.c b/server/mpm_common.c index d8222060c7..a8240026fd 100644 --- a/server/mpm_common.c +++ b/server/mpm_common.c @@ -186,7 +186,9 @@ void ap_reclaim_child_processes(int terminate) } } } -#endif /* NEED_RECLAIM_CHILD_PROCESSES */ +#endif /* AP_MPM_NEEDS_RECLAIM_CHILD_PROCESSES */ + +#ifdef AP_MPM_WANT_WAIT_OR_TIMEOUT /* number of calls to wait_or_timeout between writable probes */ #ifndef INTERVAL_OF_WRITABLE_PROBES @@ -219,7 +221,9 @@ void ap_wait_or_timeout(apr_wait_t *status, apr_proc_t *ret, apr_pool_t *p) ret->pid = -1; return; } +#endif /* AP_MPM_WANT_WAIT_OR_TIMEOUT */ +#ifdef AP_MPM_WANT_PROCESS_CHILD_STATUS void ap_process_child_status(apr_proc_t *pid, apr_wait_t status) { int signum = WTERMSIG(status); @@ -265,6 +269,7 @@ void ap_process_child_status(apr_proc_t *pid, apr_wait_t status) } } } +#endif /* AP_MPM_WANT_PROCESS_CHILD_STATUS */ #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) void ap_sock_disable_nagle(apr_socket_t *s) @@ -287,6 +292,7 @@ void ap_sock_disable_nagle(apr_socket_t *s) } #endif +#ifdef HAVE_GETPWNAM AP_DECLARE(uid_t) ap_uname2id(const char *name) { struct passwd *ent; @@ -300,7 +306,9 @@ AP_DECLARE(uid_t) ap_uname2id(const char *name) } return (ent->pw_uid); } +#endif +#ifdef HAVE_GETGRNAM AP_DECLARE(gid_t) ap_gname2id(const char *name) { struct group *ent; @@ -313,6 +321,7 @@ AP_DECLARE(gid_t) ap_gname2id(const char *name) } return (ent->gr_gid); } +#endif #ifndef HAVE_INITGROUPS int initgroups(const char *name, gid_t basegid)