* @param terminate Either 1 or 0. If 1, send the child processes SIGTERM
* each time through the loop. If 0, give the process time to die
* on its own before signalling it.
- * @tip This function requires that some hooks are implemented by the MPM: <pre>
- * mpm_get_child_pid -- Get the pid from the specified spot in the scoreboard
+ * @tip This function requires that a hook is implemented by the MPM: <pre>
* mpm_note_child_killed -- Note the child died in the scoreboard
* </pre>
* @tip The MPM child processes which are reclaimed are those listed
/**
* Catch any child processes that have been spawned by the parent process
* which have exited. This includes processes registered as "other_children".
- * @tip This function requires that some hooks are implemented by the MPM: <pre>
- * mpm_get_child_pid -- Get the pid from the specified spot in the scoreboard
+ * @tip This function requires that a hook is implemented by the MPM: <pre>
* mpm_note_child_killed -- Note the child died in the scoreboard
* </pre>
* @tip The MPM child processes which are relieved are those listed
const char *arg);
#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))
/* implement the mpm query function */
AP_DECLARE_HOOK(apr_status_t, mpm_query, (int query_code, int *result))
-/* get pid of child by index */
-AP_DECLARE_HOOK(pid_t, mpm_get_child_pid, (int childnum))
-
/* child specified by index has been killed */
AP_DECLARE_HOOK(apr_status_t, mpm_note_child_killed, (int childnum))
return APR_ENOTIMPL;
}
-static pid_t event_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t event_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
ap_hook_check_config(event_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(event_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(event_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(event_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(event_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_register_timed_callback(event_register_timed_callback, NULL, NULL,
APR_HOOK_MIDDLE);
return APR_ENOTIMPL;
}
-static pid_t prefork_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t prefork_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
ap_hook_check_config(prefork_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(prefork_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(prefork_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(prefork_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(prefork_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_get_name(prefork_get_name, NULL, NULL, APR_HOOK_MIDDLE);
}
return APR_ENOTIMPL;
}
-static pid_t worker_get_child_pid(int childnum)
-{
- return ap_scoreboard_image->parent[childnum].pid;
-}
-
static apr_status_t worker_note_child_killed(int childnum)
{
ap_scoreboard_image->parent[childnum].pid = 0;
ap_hook_check_config(worker_check_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm(worker_run, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_query(worker_query, NULL, NULL, APR_HOOK_MIDDLE);
- ap_hook_mpm_get_child_pid(worker_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_note_child_killed(worker_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_mpm_get_name(worker_get_name, NULL, NULL, APR_HOOK_MIDDLE);
}
APR_HOOK_LINK(drop_privileges)
APR_HOOK_LINK(mpm)
APR_HOOK_LINK(mpm_query)
- APR_HOOK_LINK(mpm_get_child_pid)
APR_HOOK_LINK(mpm_note_child_killed)
APR_HOOK_LINK(mpm_register_timed_callback)
APR_HOOK_LINK(mpm_get_name)
APR_HOOK_LINK(drop_privileges)
APR_HOOK_LINK(mpm)
APR_HOOK_LINK(mpm_query)
- APR_HOOK_LINK(mpm_get_child_pid)
APR_HOOK_LINK(mpm_note_child_killed)
APR_HOOK_LINK(mpm_register_timed_callback)
APR_HOOK_LINK(mpm_get_name)
AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_query,
(int query_code, int *result),
(query_code, result), APR_ENOTIMPL)
-AP_IMPLEMENT_HOOK_RUN_FIRST(pid_t, mpm_get_child_pid,
- (int childnum),
- (childnum), 0)
AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_note_child_killed,
(int childnum),
(childnum), APR_ENOTIMPL)
return ap_run_mpm_query(query_code, result);
}
-AP_DECLARE(pid_t) ap_mpm_get_child_pid(int childnum)
-{
- return ap_run_mpm_get_child_pid(childnum);
-}
-
AP_DECLARE(apr_status_t) ap_mpm_note_child_killed(int childnum)
{
return ap_run_mpm_note_child_killed(childnum);
#include "mpm_common.h"
#include "ap_mpm.h"
#include "ap_listen.h"
+#include "scoreboard.h"
#include "util_mutex.h"
#ifdef HAVE_PWD_H
/* now see who is done */
not_dead_yet = 0;
for (i = 0; i < max_daemons; ++i) {
- pid_t pid = ap_mpm_get_child_pid(i);
+ process_score *ps = ap_get_scoreboard_process(i);
+ pid_t pid = ps->pid;
if (pid == 0) {
continue; /* not every scoreboard entry is in use */
/* now see who is done */
for (i = 0; i < max_daemons; ++i) {
- pid_t pid = ap_mpm_get_child_pid(i);
+ process_score *ps = ap_get_scoreboard_process(i);
+ pid_t pid = ps->pid;
if (pid == 0) {
continue; /* not every scoreboard entry is in use */