extern apr_lockmech_e ap_accept_lock_mech;
- The system mutex implementation to use for the accept mutex.
extern const char *ap_lock_fname;
- The name of lockfile used when Apache needs to lock the accept() call.
extern int ap_max_requests_per_child;
- The maximum number of requests each child thread or process handles before dying off
extern const char *ap_pid_fname;
- The filename used to store the process id.
(apr_status_t);
- Open the pipe-of-death. The pipe of death is used to tell all child processes that it is time to die gracefully.
- Parameters
p The pool to use for allocating the pipe
(apr_status_t);
- Check the pipe to determine if the process has been signalled to die.
(apr_status_t);
- Close the pipe-of-death
(apr_status_t);
- Write data to the pipe-of-death, signalling that one child process should die.
- Parameters
p The pool to use when allocating any required structures.
(void);
- Write data to the pipe-of-death, signalling that all child process should die.
- Parameters
p The pool to use when allocating any required structures. num The number of child processes to kill
int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
- Log why a child died to the error log, if the child died without the parent signalling it.
- Parameters
pid The child that has died status The status returned from ap_wait_or_timeout - Return Value
- 0 on success, APEXIT_CHILDFATAL if MPM should terminate
void ap_reclaim_child_processes(int terminate);
- use this instead of strchr use this instead of strchr use this instead of strrchr use this instead of strrchr use this instead of strrstruse this instead of strrstrMake sure all child processes that have been spawned by the parent process have died. This includes process registered as "other_children".
This is only defined if the MPM defines AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
This function requires that some macros are defined by the MPM:
MPM_CHILD_PID -- Get the pid from the specified spot in the scoreboard MPM_NOTE_CHILD_KILLED -- Note the child died in the scoreboard@tip The MPM child processes which are reclaimed are those listed in the scoreboard as well as those currently registered via ap_register_extra_mpm_process().
- Parameters
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.
void ap_register_extra_mpm_process(pid_t pid);
- Tell ap_reclaim_child_processes() about an MPM child process which has no entry in the scoreboard.
This is only defined if the MPM defines AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
If an extra MPM child process terminates prior to calling ap_reclaim_child_processes(), remove it from the list of such processes by calling ap_unregister_extra_mpm_process().
- Parameters
pid The process id of an MPM child process which should be reclaimed when ap_reclaim_child_processes() is called.
void ap_sock_disable_nagle(apr_socket_t *s);
- Turn off the nagle algorithm for the specified socket. The nagle algorithm says that we should delay sending partial packets in the hopes of getting more data. There are bad interactions between persistent connections and Nagle's algorithm that have severe performance penalties.
- Parameters
s The socket to disable nagle for.
int ap_unregister_extra_mpm_process(pid_t pid);
- Unregister an MPM child process which was previously registered by a call to ap_register_extra_mpm_process().
This is only defined if the MPM defines AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
- Parameters
pid The process id of an MPM child process which no longer needs to be reclaimed. - Return Value
- 1 if the process was found and removed, 0 otherwise
void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret, apr_pool_t *p);
- Determine if any child process has died. If no child process died, then this process sleeps for the amount of time specified by the MPM defined macro SCOREBOARD_MAINTENANCE_INTERVAL.
- Parameters
status The return code if a process has died ret The process id of the process that died p The pool to allocate out of
gid_tap_gname2id(const char *name);
- Convert a group name to a numeric ID
- Parameters
name The name to convert - Return Value
- The group id corresponding to a name
uid_tap_uname2id(const char *name);
- Convert a username to a numeric ID
- Parameters
name The name to convert - Return Value
- The user id corresponding to a name