diff options
Diffstat (limited to 'include/apr_shm.h')
-rw-r--r-- | include/apr_shm.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/apr_shm.h b/include/apr_shm.h index 49543bb01946f..635c654b17fee 100644 --- a/include/apr_shm.h +++ b/include/apr_shm.h @@ -25,6 +25,7 @@ #include "apr.h" #include "apr_pools.h" #include "apr_errno.h" +#include "apr_perms_set.h" #ifdef __cplusplus extern "C" { @@ -136,6 +137,21 @@ APR_DECLARE(apr_status_t) apr_shm_remove(const char *filename, apr_pool_t *pool); /** + * Delete named resource associated with a shared memory segment, + * preventing attachments to the resource. + * @param m The shared memory segment structure to delete. + * @remark This function is only supported on platforms which support + * name-based shared memory segments, and will return APR_ENOTIMPL on + * platforms without such support. Removing the file while the shm + * is in use is not entirely portable, caller may use this to enhance + * obscurity of the resource, but be prepared for the call to fail, + * and for concurrent attempts to create a resource of the same name + * to also fail. The pool cleanup of apr_shm_create (apr_shm_destroy) + * also removes the named resource. + */ +APR_DECLARE(apr_status_t) apr_shm_delete(apr_shm_t *m); + +/** * Destroy a shared memory segment and associated memory. * @param m The shared memory segment structure to destroy. */ @@ -195,6 +211,11 @@ APR_DECLARE(void *) apr_shm_baseaddr_get(const apr_shm_t *m); APR_DECLARE(apr_size_t) apr_shm_size_get(const apr_shm_t *m); /** + * Set shared memory permissions. + */ +APR_PERMS_SET_IMPLEMENT(shm); + +/** * Get the pool used by this shared memory segment. */ APR_POOL_DECLARE_ACCESSOR(shm); |