/usr/src/redhat/BUILD/httpd-2.2.3/include/mpm_common.h

説明を見る。
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /* The purpose of this file is to store the code that MOST mpm's will need
00018  * this does not mean a function only goes into this file if every MPM needs
00019  * it.  It means that if a function is needed by more than one MPM, and
00020  * future maintenance would be served by making the code common, then the
00021  * function belongs here.
00022  *
00023  * This is going in src/main because it is not platform specific, it is
00024  * specific to multi-process servers, but NOT to Unix.  Which is why it
00025  * does not belong in src/os/unix
00026  */
00027 
00037 #ifndef APACHE_MPM_COMMON_H
00038 #define APACHE_MPM_COMMON_H
00039 
00040 #include "ap_config.h"
00041 
00042 #if APR_HAVE_NETINET_TCP_H
00043 #include <netinet/tcp.h>    /* for TCP_NODELAY */
00044 #endif
00045 
00046 #include "mpm.h"
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 /* The maximum length of the queue of pending connections, as defined
00053  * by listen(2).  Under some systems, it should be increased if you
00054  * are experiencing a heavy TCP SYN flood attack.
00055  *
00056  * It defaults to 511 instead of 512 because some systems store it 
00057  * as an 8-bit datatype; 512 truncated to 8-bits is 0, while 511 is 
00058  * 255 when truncated.
00059  */
00060 #ifndef DEFAULT_LISTENBACKLOG
00061 #define DEFAULT_LISTENBACKLOG 511
00062 #endif
00063         
00064 /* Signal used to gracefully restart */
00065 #define AP_SIG_GRACEFUL SIGUSR1
00066 
00067 /* Signal used to gracefully restart (without SIG prefix) */
00068 #define AP_SIG_GRACEFUL_SHORT USR1
00069 
00070 /* Signal used to gracefully restart (as a quoted string) */
00071 #define AP_SIG_GRACEFUL_STRING "SIGUSR1"
00072 
00073 /* Signal used to gracefully stop */
00074 #define AP_SIG_GRACEFUL_STOP SIGWINCH
00075 
00076 /* Signal used to gracefully stop (without SIG prefix) */
00077 #define AP_SIG_GRACEFUL_STOP_SHORT WINCH
00078 
00079 /* Signal used to gracefully stop (as a quoted string) */
00080 #define AP_SIG_GRACEFUL_STOP_STRING "SIGWINCH"
00081 
00098 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
00099 void ap_reclaim_child_processes(int terminate);
00100 #endif
00101 
00115 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
00116 void ap_relieve_child_processes(void);
00117 #endif
00118 
00130 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
00131 void ap_register_extra_mpm_process(pid_t pid);
00132 #endif
00133 
00143 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
00144 int ap_unregister_extra_mpm_process(pid_t pid);
00145 #endif
00146 
00154 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
00155 apr_status_t ap_mpm_safe_kill(pid_t pid, int sig);
00156 #endif
00157 
00166 #ifdef AP_MPM_WANT_WAIT_OR_TIMEOUT
00167 void ap_wait_or_timeout(apr_exit_why_e *status, int *exitcode, apr_proc_t *ret, 
00168                         apr_pool_t *p);
00169 #endif
00170 
00178 #ifdef AP_MPM_WANT_PROCESS_CHILD_STATUS
00179 int ap_process_child_status(apr_proc_t *pid, apr_exit_why_e why, int status);
00180 #endif
00181 
00182 #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
00183 
00190 void ap_sock_disable_nagle(apr_socket_t *s);
00191 #else
00192 #define ap_sock_disable_nagle(s)        /* NOOP */
00193 #endif
00194 
00195 #ifdef HAVE_GETPWNAM
00196 
00202 AP_DECLARE(uid_t) ap_uname2id(const char *name);
00203 #endif
00204 
00205 #ifdef HAVE_GETGRNAM
00206 
00212 AP_DECLARE(gid_t) ap_gname2id(const char *name);
00213 #endif
00214 
00215 #define AP_MPM_HARD_LIMITS_FILE APACHE_MPM_DIR "/mpm_default.h"
00216 
00217 #ifdef AP_MPM_USES_POD
00218 
00219 typedef struct ap_pod_t ap_pod_t;
00220 
00221 struct ap_pod_t {
00222     apr_file_t *pod_in;
00223     apr_file_t *pod_out;
00224     apr_pool_t *p;
00225 };
00226 
00232 AP_DECLARE(apr_status_t) ap_mpm_pod_open(apr_pool_t *p, ap_pod_t **pod);
00233 
00237 AP_DECLARE(apr_status_t) ap_mpm_pod_check(ap_pod_t *pod);
00238 
00242 AP_DECLARE(apr_status_t) ap_mpm_pod_close(ap_pod_t *pod);
00243 
00249 AP_DECLARE(apr_status_t) ap_mpm_pod_signal(ap_pod_t *pod);
00250 
00257 AP_DECLARE(void) ap_mpm_pod_killpg(ap_pod_t *pod, int num);
00258 #endif
00259 
00260 /*
00261  * These data members are common to all mpms. Each new mpm
00262  * should either use the appropriate ap_mpm_set_* function
00263  * in their command table or create their own for custom or
00264  * OS specific needs. These should work for most.
00265  */
00266 
00271 #ifdef AP_MPM_WANT_SET_MAX_REQUESTS
00272 extern int ap_max_requests_per_child;
00273 const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
00274                                     const char *arg);
00275 #endif
00276 
00280 #ifdef AP_MPM_WANT_SET_PIDFILE
00281 extern const char *ap_pid_fname;
00282 const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
00283                                const char *arg);
00284 #endif
00285 
00289 #ifdef AP_MPM_WANT_SET_LOCKFILE
00290 extern const char *ap_lock_fname;
00291 const char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
00292                                 const char *arg);
00293 #endif
00294 
00298 #ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
00299 extern apr_lockmech_e ap_accept_lock_mech;
00300 extern const char ap_valid_accept_mutex_string[];
00301 const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
00302                                         const char *arg);
00303 #endif
00304 
00305 /*
00306  * Set the scorboard file.
00307  */
00308 #ifdef AP_MPM_WANT_SET_SCOREBOARD
00309 const char *ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
00310                                   const char *arg);
00311 #endif
00312 
00313 /*
00314  * The directory that the server changes directory to dump core.
00315  */
00316 #ifdef AP_MPM_WANT_SET_COREDUMPDIR
00317 extern char ap_coredump_dir[MAX_STRING_LEN];
00318 extern int ap_coredumpdir_configured;
00319 const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
00320                                    const char *arg);
00321 #endif
00322 
00326 #ifdef AP_MPM_WANT_SET_GRACEFUL_SHUTDOWN
00327 extern int ap_graceful_shutdown_timeout;
00328 const char *ap_mpm_set_graceful_shutdown(cmd_parms *cmd, void *dummy,
00329                                          const char *arg);
00330 #define AP_GRACEFUL_SHUTDOWN_TIMEOUT_COMMAND \
00331 AP_INIT_TAKE1("GracefulShutdownTimeout", ap_mpm_set_graceful_shutdown, NULL, \
00332               RSRC_CONF, "Maximum time in seconds to wait for child "        \
00333               "processes to complete transactions during shutdown")
00334 #endif
00335 
00336 
00337 #ifdef AP_MPM_WANT_SIGNAL_SERVER
00338 int ap_signal_server(int *, apr_pool_t *);
00339 void ap_mpm_rewrite_args(process_rec *);
00340 #endif
00341 
00342 #ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
00343 extern apr_uint32_t ap_max_mem_free;
00344 extern const char *ap_mpm_set_max_mem_free(cmd_parms *cmd, void *dummy,
00345                                            const char *arg);
00346 #endif
00347 
00348 #ifdef AP_MPM_WANT_SET_STACKSIZE
00349 extern apr_size_t ap_thread_stacksize;
00350 extern const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
00351                                                const char *arg);
00352 #endif
00353 
00354 #ifdef AP_MPM_WANT_FATAL_SIGNAL_HANDLER
00355 extern apr_status_t ap_fatal_signal_setup(server_rec *s, apr_pool_t *pconf);
00356 extern apr_status_t ap_fatal_signal_child_setup(server_rec *s);
00357 #endif
00358 
00359 #if AP_ENABLE_EXCEPTION_HOOK
00360 extern const char *ap_mpm_set_exception_hook(cmd_parms *cmd, void *dummy,
00361                                              const char *arg);
00362 #endif
00363 
00364 AP_DECLARE_HOOK(int,monitor,(apr_pool_t *p))
00365 
00366 #ifdef __cplusplus
00367 }
00368 #endif
00369 
00370 #endif /* !APACHE_MPM_COMMON_H */
00371 

Apacheに対してSun Jul 19 22:05:23 2009に生成されました。  doxygen 1.4.7