#include <netinet/tcp.h> /* for TCP_NODELAY */
#endif
-#ifdef WIN32
-/* XXX temporary mitigation for Windows; other non-Unix MPMs need this hack too
- * include mpm.h to pick up the AP_MPM_NO_foo definitions
- */
-#include "mpm.h"
-#endif
-
-#ifndef AP_MPM_NO_SET_ACCEPT_LOCK_MECH
#include "apr_proc_mutex.h"
-#endif
#ifdef __cplusplus
extern "C" {
* in the scoreboard as well as those currently registered via
* ap_register_extra_mpm_process().
*/
-#ifndef AP_MPM_NO_RECLAIM_CHILD_PROCESSES
void ap_reclaim_child_processes(int terminate);
-#endif
/**
* Catch any child processes that have been spawned by the parent process
* in the scoreboard as well as those currently registered via
* ap_register_extra_mpm_process().
*/
-#ifndef AP_MPM_NO_RECLAIM_CHILD_PROCESSES
void ap_relieve_child_processes(void);
-#endif
/**
* Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about
* ap_reclaim_child_processes(), remove it from the list of such processes
* by calling ap_unregister_extra_mpm_process().
*/
-#ifndef AP_MPM_NO_RECLAIM_CHILD_PROCESSES
void ap_register_extra_mpm_process(pid_t pid);
-#endif
/**
* Unregister an MPM child process which was previously registered by a
* be reclaimed.
* @return 1 if the process was found and removed, 0 otherwise
*/
-#ifndef AP_MPM_NO_RECLAIM_CHILD_PROCESSES
int ap_unregister_extra_mpm_process(pid_t pid);
-#endif
/**
* Safely signal an MPM child process, if the process is in the
* APR_EINVAL is returned if passed either an invalid (< 1) pid, or if
* the pid is not in the current process group
*/
-#ifndef AP_MPM_NO_RECLAIM_CHILD_PROCESSES
apr_status_t ap_mpm_safe_kill(pid_t pid, int sig);
-#endif
/**
* Determine if any child process has died. If no child process died, then
* @param ret The process id of the process that died
* @param p The pool to allocate out of
*/
-#ifndef AP_MPM_NO_WAIT_OR_TIMEOUT
void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret,
apr_pool_t *p);
-#endif
/**
* Log why a child died to the error log, if the child died without the
* @param status The status returned from ap_wait_or_timeout
* @return 0 on success, APEXIT_CHILDFATAL if MPM should terminate
*/
-#ifndef AP_MPM_NO_PROCESS_CHILD_STATUS
int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
-#endif
#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
/**
#define AP_MPM_HARD_LIMITS_FILE APACHE_MPM_DIR "/mpm_default.h"
-#ifndef AP_MPM_NO_POD
-
typedef struct ap_pod_t ap_pod_t;
struct ap_pod_t {
* @param num The number of child processes to kill
*/
AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num);
-#endif
/*
* These data members are common to all mpms. Each new mpm
* The maximum number of requests each child thread or
* process handles before dying off
*/
-#ifndef AP_MPM_NO_SET_MAX_REQUESTS
extern int ap_max_requests_per_child;
const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/**
* The filename used to store the process id.
*/
-#ifndef AP_MPM_NO_SET_PIDFILE
extern const char *ap_pid_fname;
const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/**
* The name of lockfile used when Apache needs to lock the accept() call.
*/
-#ifndef AP_MPM_NO_SET_LOCKFILE
extern const char *ap_lock_fname;
const char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/**
* The system mutex implementation to use for the accept mutex.
*/
-#ifndef AP_MPM_NO_SET_ACCEPT_LOCK_MECH
extern apr_lockmech_e ap_accept_lock_mech;
const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/*
* Set the scorboard file.
*/
-#ifndef AP_MPM_NO_SET_SCOREBOARD
const char *ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/*
* The directory that the server changes directory to dump core.
*/
-#ifndef AP_MPM_NO_SET_COREDUMPDIR
extern char ap_coredump_dir[MAX_STRING_LEN];
extern int ap_coredumpdir_configured;
const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
/**
* Set the timeout period for a graceful shutdown.
*/
-#ifndef AP_MPM_NO_SET_GRACEFUL_SHUTDOWN
extern int ap_graceful_shutdown_timeout;
const char *ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
const char *arg);
AP_INIT_TAKE1("GracefulShutdownTimeout", ap_mpm_set_graceful_shutdown, NULL, \
RSRC_CONF, "Maximum time in seconds to wait for child " \
"processes to complete transactions during shutdown")
-#endif
-#ifndef AP_MPM_NO_SIGNAL_SERVER
int ap_signal_server(int *, apr_pool_t *);
void ap_mpm_rewrite_args(process_rec *);
-#endif
-#ifndef AP_MPM_NO_SET_MAX_MEM_FREE
extern apr_uint32_t ap_max_mem_free;
extern const char *ap_mpm_set_max_mem_free(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
-#ifndef AP_MPM_NO_SET_STACKSIZE
extern apr_size_t ap_thread_stacksize;
extern const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
const char *arg);
-#endif
-#ifndef AP_MPM_NO_FATAL_SIGNAL_HANDLER
extern apr_status_t ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
extern apr_status_t ap_fatal_signal_child_setup(server_rec *s);
-#endif
#if AP_ENABLE_EXCEPTION_HOOK
extern const char *ap_mpm_set_exception_hook(cmd_parms *cmd, void *dummy,
const char *arg);
#endif
-#ifndef AP_MPM_NO_CHILD_PID
-extern pid_t ap_mpm_get_child_pid(int childnum);
-extern apr_status_t ap_mpm_note_child_killed(int childnum);
-#endif
+AP_DECLARE(pid_t) ap_mpm_get_child_pid(int childnum);
+AP_DECLARE(apr_status_t) ap_mpm_note_child_killed(int childnum);
AP_DECLARE_HOOK(int,monitor,(apr_pool_t *p))