]> granicus.if.org Git - apache/commitdiff
API Cleanup in preperation for 2.4.x, make sure all exported functions or variables...
authorPaul Querna <pquerna@apache.org>
Tue, 2 Dec 2008 08:13:36 +0000 (08:13 +0000)
committerPaul Querna <pquerna@apache.org>
Tue, 2 Dec 2008 08:13:36 +0000 (08:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68

29 files changed:
CHANGES
include/ap_mmn.h
include/mpm_common.h
include/scoreboard.h
modules/arch/netware/mod_netware.c
modules/arch/unix/mod_unixd.c
modules/cache/mod_socache_dbm.c
modules/generators/mod_cgid.c
modules/mappers/mod_rewrite.c
os/unix/unixd.c
os/unix/unixd.h
server/core.c
server/core_filters.c
server/main.c
server/mpm/experimental/event/event.c
server/mpm/experimental/event/mpm.h
server/mpm/experimental/leader/leader.c
server/mpm/experimental/leader/mpm.h
server/mpm/experimental/perchild/mpm.h
server/mpm/experimental/perchild/perchild.c
server/mpm/experimental/threadpool/mpm.h
server/mpm/experimental/threadpool/threadpool.c
server/mpm/prefork/mpm.h
server/mpm/prefork/prefork.c
server/mpm/worker/mpm.h
server/mpm/worker/worker.c
server/mpm_common.c
server/request.c
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index 4c65f5bbc43ced4a18456b293ca46df4b929f612..55057a39b48fcd15c0c0c4236a9d60282aeb2afb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,18 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) Rename APIs to include ap_ prefix:
+        find_child_by_pid -> ap_find_child_by_pid
+        suck_in_APR -> ap_suck_in_APR
+        sys_privileges_handlers -> ap_sys_privileges_handlers
+        unixd_accept -> ap_unixd_accept
+        unixd_config -> ap_unixd_config
+        unixd_killpg -> ap_unixd_killpg
+        unixd_set_global_mutex_perms -> ap_unixd_set_global_mutex_perms
+        unixd_set_proc_mutex_perms -> ap_unixd_set_proc_mutex_perms
+        unixd_set_rlimit -> ap_unixd_set_rlimit
+     [Paul Querna]
+
   *) core: When the ap_http_header_filter processes an error bucket, cleanup
      the passed brigade before returning AP_FILTER_ERROR down the filter 
      chain. This unambiguously ensures the same error bucket isn't revisited
index 1efcb753e89efe18d34fdec6dbd5f6ffe0e84c0c..ef9f4dff24a80f6c516e3606f4bc4f36ae593653 100644 (file)
  *                         from util_filter.h to httpd.h and change their
  *                         numeric values so they do not overlap with other
  *                         potential status codes
+ * 20081201.0 (2.3.0-dev)  Rename several APIs to include ap_ prefix.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20081129
+#define MODULE_MAGIC_NUMBER_MAJOR 20081201
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 
index 82ab37ca554ef4961a57dfb96d99276e898dab68..ee3634e52c4b0c987244c43402f66b53de1c8dfe 100644 (file)
@@ -365,7 +365,7 @@ extern const char *ap_mpm_set_exception_hook(cmd_parms *cmd, void *dummy,
 AP_DECLARE_HOOK(int,monitor,(apr_pool_t *p))
 
 /* register modules that undertake to manage system security */
-AP_DECLARE(int) sys_privileges_handlers(int inc);
+AP_DECLARE(int) ap_sys_privileges_handlers(int inc);
 AP_DECLARE_HOOK(int, drop_privileges, (apr_pool_t * pchild, server_rec * s))
 
 #ifdef __cplusplus
index 5b79debd415fd8e706a31e7311f5b9491e3c0bff..211a3a20e1f6cf2f7711968e00305b04037df255 100644 (file)
@@ -172,7 +172,7 @@ apr_status_t ap_cleanup_scoreboard(void *d);
 AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p,
                                      int child_num, int thread_num);
     
-int find_child_by_pid(apr_proc_t *pid);
+AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid);
 AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status, request_rec *r);
 AP_DECLARE(int) ap_update_child_status_from_indexes(int child_num, int thread_num,
                                                     int status, request_rec *r);
index ea9e0f62dd99b6aa4cf257da3dcc7e02b7d3b2f6..aa8f49624294f5368e3b52bbd60510fcf33fbc30 100644 (file)
@@ -171,7 +171,7 @@ static int
 netware_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
                  apr_pool_t *ptemp)
 {
-    sys_privileges_handlers(1);
+    ap_sys_privileges_handlers(1);
     return OK;
 }
 
index 8d83d13060b6dd204c060dfb538b6be86ecd2549..30fa59f30e813271537182fc4edff096221a51da 100644 (file)
@@ -89,9 +89,9 @@ static int set_group_privs(void)
 
         /* Get username if passed as a uid */
 
-        if (unixd_config.user_name[0] == '#') {
+        if (ap_unixd_config.user_name[0] == '#') {
             struct passwd *ent;
-            uid_t uid = atol(&unixd_config.user_name[1]);
+            uid_t uid = atol(&ap_unixd_config.user_name[1]);
 
             if ((ent = getpwuid(uid)) == NULL) {
                 ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
@@ -104,7 +104,7 @@ static int set_group_privs(void)
             name = ent->pw_name;
         }
         else
-            name = unixd_config.user_name;
+            name = ap_unixd_config.user_name;
 
 #if !defined(OS2) && !defined(TPF)
         /* OS/2 and TPF don't support groups. */
@@ -113,19 +113,19 @@ static int set_group_privs(void)
          * Set the GID before initgroups(), since on some platforms
          * setgid() is known to zap the group list.
          */
-        if (setgid(unixd_config.group_id) == -1) {
+        if (setgid(ap_unixd_config.group_id) == -1) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                         "setgid: unable to set group id to Group %u",
-                        (unsigned)unixd_config.group_id);
+                        (unsigned)ap_unixd_config.group_id);
             return -1;
         }
 
         /* Reset `groups' attributes. */
 
-        if (initgroups(name, unixd_config.group_id) == -1) {
+        if (initgroups(name, ap_unixd_config.group_id) == -1) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                         "initgroups: unable to set groups for User %s "
-                        "and Group %u", name, (unsigned)unixd_config.group_id);
+                        "and Group %u", name, (unsigned)ap_unixd_config.group_id);
             return -1;
         }
 #endif /* !defined(OS2) && !defined(TPF) */
@@ -143,7 +143,7 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
         return rv;
     }
 
-    if (NULL != unixd_config.chroot_dir) {
+    if (NULL != ap_unixd_config.chroot_dir) {
         if (geteuid()) {
             rv = errno;
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
@@ -151,17 +151,17 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
             return rv;
         }
 
-        if (chdir(unixd_config.chroot_dir) != 0) {
+        if (chdir(ap_unixd_config.chroot_dir) != 0) {
             rv = errno;
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
-                         "Can't chdir to %s", unixd_config.chroot_dir);
+                         "Can't chdir to %s", ap_unixd_config.chroot_dir);
             return rv;
         }
 
-        if (chroot(unixd_config.chroot_dir) != 0) {
+        if (chroot(ap_unixd_config.chroot_dir) != 0) {
             rv = errno;
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
-                         "Can't chroot to %s", unixd_config.chroot_dir);
+                         "Can't chroot to %s", ap_unixd_config.chroot_dir);
             return rv;
         }
 
@@ -175,14 +175,14 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
 
 #ifdef MPE
     /* Only try to switch if we're running as MANAGER.SYS */
-    if (geteuid() == 1 && unixd_config.user_id > 1) {
+    if (geteuid() == 1 && ap_unixd_config.user_id > 1) {
         GETPRIVMODE();
-        if (setuid(unixd_config.user_id) == -1) {
+        if (setuid(ap_unixd_config.user_id) == -1) {
             GETUSERMODE();
             rv = errno;
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                         "setuid: unable to change to uid: %ld",
-                        (long) unixd_config.user_id);
+                        (long) ap_unixd_config.user_id);
             return rv;
         }
         GETUSERMODE();
@@ -191,13 +191,13 @@ unixd_drop_privileges(apr_pool_t *pool, server_rec *s)
     /* Only try to switch if we're running as root */
     if (!geteuid() && (
 #ifdef _OSD_POSIX
-        os_init_job_environment(NULL, unixd_config.user_name, ap_exists_config_define("DEBUG")) != 0 ||
+        os_init_job_environment(NULL, ap_unixd_config.user_name, ap_exists_config_define("DEBUG")) != 0 ||
 #endif
-        setuid(unixd_config.user_id) == -1)) {
+        setuid(ap_unixd_config.user_id) == -1)) {
         rv = errno;
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                     "setuid: unable to change to uid: %ld",
-                    (long) unixd_config.user_id);
+                    (long) ap_unixd_config.user_id);
         return rv;
     }
 #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
@@ -229,10 +229,10 @@ unixd_set_user(cmd_parms *cmd, void *dummy,
         return err;
     }
 
-    unixd_config.user_name = arg;
-    unixd_config.user_id = ap_uname2id(arg);
+    ap_unixd_config.user_name = arg;
+    ap_unixd_config.user_id = ap_uname2id(arg);
 #if !defined (BIG_SECURITY_HOLE) && !defined (OS2)
-    if (unixd_config.user_id == 0) {
+    if (ap_unixd_config.user_id == 0) {
         return "Error:\tApache has not been designed to serve pages while\n"
                 "\trunning as root.  There are known race conditions that\n"
                 "\twill allow any local user to read any file on the system.\n"
@@ -257,7 +257,7 @@ unixd_set_group(cmd_parms *cmd, void *dummy,
         return err;
     }
 
-    unixd_config.group_id = ap_gname2id(arg);
+    ap_unixd_config.group_id = ap_gname2id(arg);
 
     return NULL;
 }
@@ -274,7 +274,7 @@ unixd_set_chroot_dir(cmd_parms *cmd, void *dummy,
         return "ChrootDir must be a valid directory";
     }
 
-    unixd_config.chroot_dir = arg;
+    ap_unixd_config.chroot_dir = arg;
     return NULL;
 }
 
@@ -283,22 +283,22 @@ unixd_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
                  apr_pool_t *ptemp)
 {
     apr_finfo_t wrapper;
-    unixd_config.user_name = DEFAULT_USER;
-    unixd_config.user_id = ap_uname2id(DEFAULT_USER);
-    unixd_config.group_id = ap_gname2id(DEFAULT_GROUP);
+    ap_unixd_config.user_name = DEFAULT_USER;
+    ap_unixd_config.user_id = ap_uname2id(DEFAULT_USER);
+    ap_unixd_config.group_id = ap_gname2id(DEFAULT_GROUP);
 
-    unixd_config.chroot_dir = NULL; /* none */
+    ap_unixd_config.chroot_dir = NULL; /* none */
 
     /* Check for suexec */
-    unixd_config.suexec_enabled = 0;
+    ap_unixd_config.suexec_enabled = 0;
     if ((apr_stat(&wrapper, SUEXEC_BIN, APR_FINFO_NORM, ptemp))
          == APR_SUCCESS) {
         if ((wrapper.protection & APR_USETID) && wrapper.user == 0) {
-            unixd_config.suexec_enabled = 1;
+            ap_unixd_config.suexec_enabled = 1;
         }
     }
 
-    sys_privileges_handlers(1);
+    ap_sys_privileges_handlers(1);
     return OK;
 }
 
@@ -308,20 +308,20 @@ AP_DECLARE(int) unixd_setup_child(void)
         return -1;
     }
 
-    if (NULL != unixd_config.chroot_dir) {
+    if (NULL != ap_unixd_config.chroot_dir) {
         if (geteuid()) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                          "Cannot chroot when not started as root");
             return -1;
         }
-        if (chdir(unixd_config.chroot_dir) != 0) {
+        if (chdir(ap_unixd_config.chroot_dir) != 0) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
-                         "Can't chdir to %s", unixd_config.chroot_dir);
+                         "Can't chdir to %s", ap_unixd_config.chroot_dir);
             return -1;
         }
-        if (chroot(unixd_config.chroot_dir) != 0) {
+        if (chroot(ap_unixd_config.chroot_dir) != 0) {
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
-                         "Can't chroot to %s", unixd_config.chroot_dir);
+                         "Can't chroot to %s", ap_unixd_config.chroot_dir);
             return -1;
         }
         if (chdir("/") != 0) {
@@ -333,13 +333,13 @@ AP_DECLARE(int) unixd_setup_child(void)
 
 #ifdef MPE
     /* Only try to switch if we're running as MANAGER.SYS */
-    if (geteuid() == 1 && unixd_config.user_id > 1) {
+    if (geteuid() == 1 && ap_unixd_config.user_id > 1) {
         GETPRIVMODE();
-        if (setuid(unixd_config.user_id) == -1) {
+        if (setuid(ap_unixd_config.user_id) == -1) {
             GETUSERMODE();
             ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                         "setuid: unable to change to uid: %ld",
-                        (long) unixd_config.user_id);
+                        (long) ap_unixd_config.user_id);
             exit(1);
         }
         GETUSERMODE();
@@ -348,12 +348,12 @@ AP_DECLARE(int) unixd_setup_child(void)
     /* Only try to switch if we're running as root */
     if (!geteuid() && (
 #ifdef _OSD_POSIX
-        os_init_job_environment(NULL, unixd_config.user_name, ap_exists_config_define("DEBUG")) != 0 ||
+        os_init_job_environment(NULL, ap_unixd_config.user_name, ap_exists_config_define("DEBUG")) != 0 ||
 #endif
-        setuid(unixd_config.user_id) == -1)) {
+        setuid(ap_unixd_config.user_id) == -1)) {
         ap_log_error(APLOG_MARK, APLOG_ALERT, errno, NULL,
                     "setuid: unable to change to uid: %ld",
-                    (long) unixd_config.user_id);
+                    (long) ap_unixd_config.user_id);
         return -1;
     }
 #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
index 4efe4fb4420b196a8636483492a4b32893dae072..c73cf5f169b3d3bca08f8bf813d39bfe25eb6d0e 100644 (file)
@@ -128,20 +128,20 @@ static apr_status_t socache_dbm_init(ap_socache_instance_t *ctx,
      * cannot exactly determine the suffixes we try all possibilities.
      */
     if (geteuid() == 0 /* is superuser */) {
-        chown(ctx->data_file, unixd_config.user_id, -1 /* no gid change */);
+        chown(ctx->data_file, ap_unixd_config.user_id, -1 /* no gid change */);
         if (chown(apr_pstrcat(p, ctx->data_file, SSL_DBM_FILE_SUFFIX_DIR, NULL),
-                  unixd_config.user_id, -1) == -1) {
+                  ap_unixd_config.user_id, -1) == -1) {
             if (chown(apr_pstrcat(p, ctx->data_file, ".db", NULL),
-                      unixd_config.user_id, -1) == -1)
+                      ap_unixd_config.user_id, -1) == -1)
                 chown(apr_pstrcat(p, ctx->data_file, ".dir", NULL),
-                      unixd_config.user_id, -1);
+                      ap_unixd_config.user_id, -1);
         }
         if (chown(apr_pstrcat(p, ctx->data_file, SSL_DBM_FILE_SUFFIX_PAG, NULL),
-                  unixd_config.user_id, -1) == -1) {
+                  ap_unixd_config.user_id, -1) == -1) {
             if (chown(apr_pstrcat(p, ctx->data_file, ".db", NULL),
-                      unixd_config.user_id, -1) == -1)
+                      ap_unixd_config.user_id, -1) == -1)
                 chown(apr_pstrcat(p, ctx->data_file, ".pag", NULL),
-                      unixd_config.user_id, -1);
+                      ap_unixd_config.user_id, -1);
         }
     }
 #endif
index f07ff7a755ab5a280465aebe487c2c56821f62fc..c3aa26d66f1b26c09c98ec4408480a229e0765a7 100644 (file)
@@ -622,7 +622,7 @@ static int cgid_server(void *data)
     }
 
     if (!geteuid()) {
-        if (chown(sockname, unixd_config.user_id, -1) < 0) {
+        if (chown(sockname, ap_unixd_config.user_id, -1) < 0) {
             ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server,
                          "Couldn't change owner of unix domain socket %s",
                          sockname);
index b47b2211807033079cd16a9f401c5ec4393b4bc1..84676395bc062a9cc581e3af8c6e94ad4b3caf7b 100644 (file)
@@ -2607,7 +2607,7 @@ static apr_status_t rewritelock_create(server_rec *s, apr_pool_t *p)
     }
 
 #ifdef AP_NEED_SET_MUTEX_PERMS
-    rc = unixd_set_global_mutex_perms(rewrite_mapr_lock_acquire);
+    rc = ap_unixd_set_global_mutex_perms(rewrite_mapr_lock_acquire);
     if (rc != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rc, s,
                      "mod_rewrite: Parent could not set permissions "
@@ -4245,7 +4245,7 @@ static int post_config(apr_pool_t *p,
     }
 
 #ifdef AP_NEED_SET_MUTEX_PERMS
-    rv = unixd_set_global_mutex_perms(rewrite_log_lock);
+    rv = ap_unixd_set_global_mutex_perms(rewrite_log_lock);
     if (rv != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s,
                      "mod_rewrite: Could not set permissions on "
index bd0baeb163f2149aeb0ee290d366ac1d9374b09f..91263d9fd3444d2878e48cb28ef2bddd536cc3b7 100644 (file)
 #include <sys/prctl.h>
 #endif
 
-unixd_config_rec unixd_config;
+unixd_config_rec ap_unixd_config;
 
 
-AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
-                           const char *arg, const char * arg2, int type)
+AP_DECLARE(void) ap_unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
+                                     const char *arg,
+                                     const char * arg2, int type)
 {
 #if (defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS)) && APR_HAVE_STRUCT_RLIMIT && APR_HAVE_GETRLIMIT
     char *str;
@@ -133,7 +134,7 @@ static apr_status_t ap_unix_create_privileged_process(
     char *execuser, *execgroup;
     const char *argv0;
 
-    if (!unixd_config.suexec_enabled) {
+    if (!ap_unixd_config.suexec_enabled) {
         return apr_proc_create(newproc, progname, args, env, attr, p);
     }
 
@@ -221,7 +222,7 @@ static apr_lockmech_e proc_mutex_mech(apr_proc_mutex_t *pmutex)
     return APR_LOCK_DEFAULT;
 }
 
-AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
+AP_DECLARE(apr_status_t) ap_unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
 {
     if (!geteuid()) {
         apr_lockmech_e mech = proc_mutex_mech(pmutex);
@@ -242,8 +243,8 @@ AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
             struct semid_ds buf;
 
             apr_os_proc_mutex_get(&ospmutex, pmutex);
-            buf.sem_perm.uid = unixd_config.user_id;
-            buf.sem_perm.gid = unixd_config.group_id;
+            buf.sem_perm.uid = ap_unixd_config.user_id;
+            buf.sem_perm.gid = ap_unixd_config.group_id;
             buf.sem_perm.mode = 0600;
             ick.buf = &buf;
             if (semctl(ospmutex.crossproc, 0, IPC_SET, ick) < 0) {
@@ -258,7 +259,7 @@ AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
             const char *lockfile = apr_proc_mutex_lockfile(pmutex);
 
             if (lockfile) {
-                if (chown(lockfile, unixd_config.user_id,
+                if (chown(lockfile, ap_unixd_config.user_id,
                           -1 /* no gid change */) < 0) {
                     return errno;
                 }
@@ -274,20 +275,20 @@ AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex)
     return APR_SUCCESS;
 }
 
-AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
+AP_DECLARE(apr_status_t) ap_unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
 {
 #if !APR_PROC_MUTEX_IS_GLOBAL
     apr_os_global_mutex_t osgmutex;
     apr_os_global_mutex_get(&osgmutex, gmutex);
-    return unixd_set_proc_mutex_perms(osgmutex.proc_mutex);
+    return ap_unixd_set_proc_mutex_perms(osgmutex.proc_mutex);
 #else  /* APR_PROC_MUTEX_IS_GLOBAL */
     /* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */
-    return unixd_set_proc_mutex_perms(gmutex);
+    return ap_unixd_set_proc_mutex_perms(gmutex);
 #endif /* APR_PROC_MUTEX_IS_GLOBAL */
 }
 
-AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
-                                        apr_pool_t *ptrans)
+AP_DECLARE(apr_status_t) ap_unixd_accept(void **accepted, ap_listen_rec *lr,
+                                         apr_pool_t *ptrans)
 {
     apr_socket_t *csd;
     apr_status_t status;
index 80006eb73b1d7773af74a814a67513d64a796156..882dd5f5ea98212705981936ce07348509765e8e 100644 (file)
@@ -78,11 +78,12 @@ typedef struct {
     int suexec_enabled;
     const char *chroot_dir;
 } unixd_config_rec;
-AP_DECLARE_DATA extern unixd_config_rec unixd_config;
+AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;
 
 #if defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS)
-AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
-                           const char *arg, const char * arg2, int type);
+AP_DECLARE(void) ap_unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
+                                     const char *arg, 
+                                     const char * arg2, int type);
 #endif
 
 /**
@@ -94,15 +95,15 @@ AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit,
  * for SysV semaphores.  Otherwise, it is safe to call it for all
  * mutex types.
  */
-AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex);
-AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex);
-AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr, apr_pool_t *ptrans);
+AP_DECLARE(apr_status_t) ap_unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex);
+AP_DECLARE(apr_status_t) ap_unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex);
+AP_DECLARE(apr_status_t) ap_unixd_accept(void **accepted, ap_listen_rec *lr, apr_pool_t *ptrans);
 
 #ifdef HAVE_KILLPG
-#define unixd_killpg(x, y)     (killpg ((x), (y)))
+#define ap_unixd_killpg(x, y)  (killpg ((x), (y)))
 #define ap_os_killpg(x, y)      (killpg ((x), (y)))
 #else /* HAVE_KILLPG */
-#define unixd_killpg(x, y)     (kill (-(x), (y)))
+#define ap_unixd_killpg(x, y)  (kill (-(x), (y)))
 #define ap_os_killpg(x, y)      (kill (-(x), (y)))
 #endif /* HAVE_KILLPG */
 
index 4199cfc65c338656e0ec35f53ecab5c27bb3b38a..e5a09bad76e8245d03504aac933ef1e87f97ae1a 100644 (file)
@@ -3680,23 +3680,23 @@ static int default_handler(request_rec *r)
 /* Optional function coming from mod_logio, used for logging of output
  * traffic
  */
-APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
-APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *authz_ap_some_auth_required;
+APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *ap__logio_add_bytes_out;
+APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *ap__authz_ap_some_auth_required;
 
 /* Insist that at least one module will undertake to provide system
  * security by dropping startup privileges.
  */
 static int sys_privileges = 0;
-AP_DECLARE(int) sys_privileges_handlers(int inc)
+AP_DECLARE(int) ap_sys_privileges_handlers(int inc)
 {
     sys_privileges += inc;
     return sys_privileges;
 }
 static int core_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
 {
-    logio_add_bytes_out = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_out);
+    ap__logio_add_bytes_out = APR_RETRIEVE_OPTIONAL_FN(ap_logio_add_bytes_out);
     ident_lookup = APR_RETRIEVE_OPTIONAL_FN(ap_ident_lookup);
-    authz_ap_some_auth_required = APR_RETRIEVE_OPTIONAL_FN(authz_some_auth_required);
+    ap__authz_ap_some_auth_required = APR_RETRIEVE_OPTIONAL_FN(authz_some_auth_required);
     authn_ap_auth_type = APR_RETRIEVE_OPTIONAL_FN(authn_ap_auth_type);
     authn_ap_auth_name = APR_RETRIEVE_OPTIONAL_FN(authn_ap_auth_name);
     access_compat_ap_satisfies = APR_RETRIEVE_OPTIONAL_FN(access_compat_ap_satisfies);
index 9a07252e050d562a3b295135d7448d9e370645cc..82a7f8def3c8fc6b3731268295d9fcaa0a286ff8 100644 (file)
@@ -371,7 +371,7 @@ static apr_status_t sendfile_nonblocking(apr_socket_t *s,
 /* Optional function coming from mod_logio, used for logging of output
  * traffic
  */
-extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
+extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *ap__logio_add_bytes_out;
 
 apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *new_bb)
 {
@@ -751,8 +751,8 @@ static apr_status_t writev_nonblocking(apr_socket_t *s,
             break;
         }
     }
-    if ((logio_add_bytes_out != NULL) && (bytes_written > 0)) {
-        logio_add_bytes_out(c, bytes_written);
+    if ((ap__logio_add_bytes_out != NULL) && (bytes_written > 0)) {
+        ap__logio_add_bytes_out(c, bytes_written);
     }
     *cumulative_bytes_written += bytes_written;
 
@@ -813,8 +813,8 @@ static apr_status_t sendfile_nonblocking(apr_socket_t *s,
             rv = arv;
         }
     }
-    if ((logio_add_bytes_out != NULL) && (bytes_written > 0)) {
-        logio_add_bytes_out(c, bytes_written);
+    if ((ap__logio_add_bytes_out != NULL) && (bytes_written > 0)) {
+        ap__logio_add_bytes_out(c, bytes_written);
     }
     *cumulative_bytes_written += bytes_written;
     if ((bytes_written < file_length) && (bytes_written > 0)) {
index 02a66a5234a383fb7181f6a094d3577a71bb949b..f9c8d89f223f8bf64da440d9651a2ffc662de236 100644 (file)
@@ -798,8 +798,8 @@ int main(int argc, const char * const argv[])
  * has all of the APR functions specified by the apr/apr.exports and
  * apr-util/aprutil.exports files.
  */
-const void *suck_in_APR(void);
-const void *suck_in_APR(void)
+const void *ap_suck_in_APR(void);
+const void *ap_suck_in_APR(void)
 {
     extern const void *ap_ugly_hack;
 
index 2fc5c69b68720a341d5a4bf498b6fd0e3ef9cf9f..21c3e70a84cd5112610a819329921dc4551511ad 100644 (file)
@@ -160,7 +160,7 @@ static fd_queue_info_t *worker_queue_info;
 static int mpm_state = AP_MPMQ_STARTING;
 static int sick_child_detected;
 
-apr_thread_mutex_t *timeout_mutex;
+static apr_thread_mutex_t *timeout_mutex;
 APR_RING_HEAD(timeout_head_t, conn_state_t);
 static struct timeout_head_t timeout_head, keepalive_timeout_head;
 
@@ -2025,7 +2025,7 @@ static void server_main_loop(int remaining_children_to_start)
                 sick_child_detected = 1;
             }
             /* non-fatal death... note that it's gone in the scoreboard. */
-            child_slot = find_child_by_pid(&pid);
+            child_slot = ap_find_child_by_pid(&pid);
             if (child_slot >= 0) {
                 for (i = 0; i < ap_threads_per_child; i++)
                     ap_update_child_status_from_indexes(child_slot, i,
index 94f87e29adfa84f3847744d87fd1529308170d34..d38c1f1e3ae37aed8ece993716c12c6811fcd72d 100644 (file)
@@ -53,7 +53,7 @@
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 extern int ap_threads_per_child;
 extern int ap_max_daemons_limit;
index 7bc652e756339eb9c3ee12f909d9ff5cdba30f4c..df5b0c27fd6d75f86993955e70f14fc20447aaef 100644 (file)
@@ -1020,7 +1020,7 @@ static void child_main(int child_num_arg)
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
-    if (unixd_setup_child()) {
+    if (ap_unixd_setup_child()) {
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
@@ -1372,7 +1372,7 @@ static void server_main_loop(int remaining_children_to_start)
                 return;
             }
             /* non-fatal death... note that it's gone in the scoreboard. */
-            child_slot = find_child_by_pid(&pid);
+            child_slot = ap_find_child_by_pid(&pid);
             if (child_slot >= 0) {
                 for (i = 0; i < ap_threads_per_child; i++)
                     ap_update_child_status_from_indexes(child_slot, i, SERVER_DEAD,
@@ -1469,7 +1469,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 #else
     if (ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
 #endif
-        rv = unixd_set_proc_mutex_perms(accept_mutex);
+        rv = ap_unixd_set_proc_mutex_perms(accept_mutex);
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
                          "Couldn't set permissions on cross-process lock; "
@@ -1540,7 +1540,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
          * (By "gracefully" we don't mean graceful in the same sense as
          * "apachectl graceful" where we allow old connections to finish.)
          */
-        if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
+        if (ap_unixd_killpg(getpgrp(), SIGTERM) < 0) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGTERM");
         }
         ap_reclaim_child_processes(1);                /* Start with SIGTERM */
@@ -1704,7 +1704,7 @@ static int leader_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
         parent_pid = ap_my_pid = getpid();
     }
 
-    unixd_pre_config(ptemp);
+    ap_unixd_pre_config(ptemp);
     ap_listen_pre_config();
     ap_daemons_to_start = DEFAULT_START_DAEMON;
     min_spare_threads = DEFAULT_MIN_FREE_DAEMON * DEFAULT_THREADS_PER_CHILD;
index d30be86a1fd0536f49a14edb06e6fee5966ff9d0..8c4b846368d32c3751a0429bc19ac0c1041a3d77 100644 (file)
@@ -51,7 +51,7 @@
 #define AP_MPM_USES_POD 1
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 extern int ap_threads_per_child;
 extern int ap_max_daemons_limit;
index af9723872871c2a1dfec16e0cbbe00465ad92e75..d4ed6e5713d341c654961f798fb58b8c27a136eb 100644 (file)
@@ -50,7 +50,7 @@
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 /* Table of child status */
 #define SERVER_DEAD 0
index bf0295eb8bfc7dff98fa437f5ebb5ea06ae283ef..8dfdb864724f39619d208c9291f7803537be84b1 100644 (file)
@@ -859,7 +859,7 @@ static int perchild_setup_child(int childnum)
     child_info_t *ug = &child_info_table[childnum];
 
     if (ug->uid == -1 && ug->gid == -1) {
-        return unixd_setup_child();
+        return ap_unixd_setup_child();
     }
     if (set_group_privs(ug->uid, ug->gid)) {
         return -1;
@@ -868,7 +868,7 @@ static int perchild_setup_child(int childnum)
     if (!geteuid()
         && (
 #ifdef _OSD_POSIX
-            os_init_job_environment(server_conf, unixd_config.user_name,
+            os_init_job_environment(server_conf, ap_unixd_config.user_name,
                                     one_process) != 0 ||
 #endif
             setuid(ug->uid) == -1)) {
@@ -1329,7 +1329,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
         /* Time to gracefully shut down:
          * Kill child processes, tell them to call child_exit, etc...
          */
-        if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
+        if (ap_unixd_killpg(getpgrp(), SIGTERM) < 0) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
                          "killpg SIGTERM");
         }
@@ -1392,7 +1392,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
          * and a SIGHUP, we may as well use the same signal, because some user
          * pthreads are stealing signals from us left and right.
          */
-        if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
+        if (ap_unixd_killpg(getpgrp(), SIGTERM) < 0) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf,
                          "killpg SIGTERM");
         }
@@ -1483,7 +1483,7 @@ static int perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem
         my_pid = getpid();
     }
 
-    unixd_pre_config(ptemp);
+    ap_unixd_pre_config(ptemp);
     ap_listen_pre_config();
     num_daemons = DEFAULT_NUM_DAEMON;
     threads_to_start = DEFAULT_START_THREAD;
index 806011b88570498a1c147776cce62d73c2c644f1..d42d245963bcf49eb947f538be5a83f43bc1e80e 100644 (file)
@@ -50,7 +50,7 @@
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 extern int ap_threads_per_child;
 extern int ap_max_daemons_limit;
index 938816af42ed9b8f5b4febaccf209c4c987d47ae..df8575284fc86055ccd4ae1d8a6448ba1b24a5a2 100644 (file)
@@ -1243,7 +1243,7 @@ static void child_main(int child_num_arg)
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
-    if (unixd_setup_child()) {
+    if (ap_unixd_setup_child()) {
         clean_child_exit(APEXIT_CHILDFATAL);
     }
 
@@ -1629,7 +1629,7 @@ static void server_main_loop(int remaining_children_to_start)
                 return;
             }
             /* non-fatal death... note that it's gone in the scoreboard. */
-            child_slot = find_child_by_pid(&pid);
+            child_slot = ap_find_child_by_pid(&pid);
             if (child_slot >= 0) {
                 for (i = 0; i < ap_threads_per_child; i++)
                     ap_update_child_status_from_indexes(child_slot, i, SERVER_DEAD,
@@ -1726,7 +1726,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 #else
     if (ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
 #endif
-        rv = unixd_set_proc_mutex_perms(accept_mutex);
+        rv = ap_unixd_set_proc_mutex_perms(accept_mutex);
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
                          "Couldn't set permissions on cross-process lock; "
@@ -1966,7 +1966,7 @@ static int worker_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
         parent_pid = ap_my_pid = getpid();
     }
 
-    unixd_pre_config(ptemp);
+    ap_unixd_pre_config(ptemp);
     ap_listen_pre_config();
     ap_daemons_to_start = DEFAULT_START_DAEMON;
     min_spare_threads = DEFAULT_MIN_FREE_DAEMON * DEFAULT_THREADS_PER_CHILD;
index bf1fb949996fe8adc21b92ca8eacbe72dd8e27fc..36c7b576071bc3cd6641ec2476f256bc25382633 100644 (file)
@@ -53,7 +53,7 @@
 #define AP_MPM_USES_POD 1
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 extern int ap_threads_per_child;
 extern int ap_max_daemons_limit;
index 326d4d36276efa6c7a742d3b0d4421875b35217a..c7b27dd39aef9375d52e3f59ec369eca63669c59 100644 (file)
@@ -664,7 +664,7 @@ static int make_child(server_rec *s, int slot)
 
 #ifdef _OSD_POSIX
     /* BS2000 requires a "special" version of fork() before a setuid() call */
-    if ((pid = os_fork(unixd_config.user_name)) == -1) {
+    if ((pid = os_fork(ap_unixd_config.user_name)) == -1) {
 #elif defined(TPF)
     if ((pid = os_fork(s, slot)) == -1) {
 #else
@@ -897,7 +897,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 #else
     if (ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
 #endif
-        rv = unixd_set_proc_mutex_perms(accept_mutex);
+        rv = ap_unixd_set_proc_mutex_perms(accept_mutex);
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
                          "Couldn't set permissions on cross-process lock; "
@@ -987,7 +987,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
             }
 
             /* non-fatal death... note that it's gone in the scoreboard. */
-            child_slot = find_child_by_pid(&pid);
+            child_slot = ap_find_child_by_pid(&pid);
             if (child_slot >= 0) {
                 (void) ap_update_child_status_from_indexes(child_slot, 0, SERVER_DEAD,
                                                            (request_rec *) NULL);
@@ -1056,7 +1056,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
         /* Time to shut down:
          * Kill child processes, tell them to call child_exit, etc...
          */
-        if (unixd_killpg(getpgrp(), SIGTERM) < 0) {
+        if (ap_unixd_killpg(getpgrp(), SIGTERM) < 0) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGTERM");
         }
         ap_reclaim_child_processes(1);          /* Start with SIGTERM */
@@ -1147,7 +1147,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
          * way, try and make sure that all of our processes are
          * really dead.
          */
-        unixd_killpg(getpgrp(), SIGTERM);
+        ap_unixd_killpg(getpgrp(), SIGTERM);
 
         return 1;
     }
@@ -1195,7 +1195,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
     }
     else {
         /* Kill 'em off */
-        if (unixd_killpg(getpgrp(), SIGHUP) < 0) {
+        if (ap_unixd_killpg(getpgrp(), SIGHUP) < 0) {
             ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "killpg SIGHUP");
         }
         ap_reclaim_child_processes(0);          /* Not when just starting up */
index 335f4b6ace40aef35162eb42749ff2c88b08a762..59fe752b0270167fcff51bceca00739d1bd86845 100644 (file)
@@ -51,7 +51,7 @@
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
-#define MPM_ACCEPT_FUNC unixd_accept
+#define MPM_ACCEPT_FUNC ap_unixd_accept
 
 extern int ap_threads_per_child;
 extern int ap_max_daemons_limit;
index fd71aa9aac97358ac092377bfc9d6ab91c1264e9..accf4c71feccd83112bcb703aaf1c655b415b25a 100644 (file)
@@ -1583,7 +1583,7 @@ static void server_main_loop(int remaining_children_to_start)
                 sick_child_detected = 1;
             }
             /* non-fatal death... note that it's gone in the scoreboard. */
-            child_slot = find_child_by_pid(&pid);
+            child_slot = ap_find_child_by_pid(&pid);
             if (child_slot >= 0) {
                 for (i = 0; i < ap_threads_per_child; i++)
                     ap_update_child_status_from_indexes(child_slot, i, SERVER_DEAD,
@@ -1674,7 +1674,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s)
 #else
     if (ap_accept_lock_mech == APR_LOCK_SYSVSEM) {
 #endif
-        rv = unixd_set_proc_mutex_perms(accept_mutex);
+        rv = ap_unixd_set_proc_mutex_perms(accept_mutex);
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_EMERG, rv, s,
                          "Couldn't set permissions on cross-process lock; "
index 1b292814f40ec56ffeb8905f100243cc01f07ad5..f5941f51be213dec84172a39b554ec2e81d1a9c4 100644 (file)
@@ -1139,7 +1139,7 @@ const char *ap_mpm_set_thread_stacksize(cmd_parms *cmd, void *dummy,
 #ifdef AP_MPM_WANT_FATAL_SIGNAL_HANDLER
 
 static pid_t parent_pid, my_pid;
-apr_pool_t *pconf;
+static apr_pool_t *pconf;
 
 #if AP_ENABLE_EXCEPTION_HOOK
 
index 75b79305519d5e2d494d8cfe0f49fc3cc935ecc5..f34f9f5723f4ff1aa948854456365b977d65f275 100644 (file)
@@ -1666,13 +1666,13 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_sub_req_output_filter(ap_filter_t *f,
     return APR_SUCCESS;
 }
 
-extern APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *authz_ap_some_auth_required;
+extern APR_OPTIONAL_FN_TYPE(authz_some_auth_required) *ap__authz_ap_some_auth_required;
 
 AP_DECLARE(int) ap_some_auth_required(request_rec *r)
 {
     /* Is there a require line configured for the type of *this* req? */
-    if (authz_ap_some_auth_required) {
-        return authz_ap_some_auth_required(r);
+    if (ap__authz_ap_some_auth_required) {
+        return ap__authz_ap_some_auth_required(r);
     }
     else
         return 0;
index ae834dcd9ce90fd714020feaf3d66a63846583e4..43e0513f5f7c988e4ae68268b36301a876113f82 100644 (file)
@@ -368,7 +368,7 @@ AP_DECLARE(void) ap_increment_counts(ap_sb_handle_t *sb, request_rec *r)
     ws->conn_bytes += r->bytes_sent;
 }
 
-int find_child_by_pid(apr_proc_t *pid)
+AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid)
 {
     int i;
     int max_daemons_limit;