From: Aaron Bannert Date: Mon, 6 May 2002 18:19:53 +0000 (+0000) Subject: Add unixd_set_global_mutex_perms so we can set permissions on things like X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=738b26af416aa7fd446fffd0364c92e283c08f3f;p=apache Add unixd_set_global_mutex_perms so we can set permissions on things like SysV Semaphores in the core and modules. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94968 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/os/unix/unixd.c b/os/unix/unixd.c index 5b655d36e4..16249dfe4a 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -414,6 +414,18 @@ 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) +{ +#if !APR_PROCESS_LOCK_IS_GLOBAL + apr_os_global_mutex_t osgmutex; + apr_os_global_mutex_get(&osgmutex, gmutex); + return unixd_set_proc_mutex_perms(osgmutex.proc_mutex); +#else /* APR_PROCESS_LOCK_IS_GLOBAL */ + /* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */ + return unixd_set_proc_mutex_perms((apr_proc_mutex_t *)gmutex); +#endif /* APR_PROCESS_LOCK_IS_GLOBAL */ +} + AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr, apr_pool_t *ptrans) { diff --git a/os/unix/unixd.h b/os/unix/unixd.h index 144cdf979f..7f8498580a 100644 --- a/os/unix/unixd.h +++ b/os/unix/unixd.h @@ -71,6 +71,7 @@ #include "apr_hooks.h" #include "apr_thread_proc.h" #include "apr_proc_mutex.h" +#include "apr_global_mutex.h" #include #include @@ -120,6 +121,7 @@ AP_DECLARE(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, const char *arg, const char * arg2, int type); #endif 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); #ifdef HAVE_KILLPG