Apache2
apr_arch_inherit.h File Reference
#include "apr_inherit.h"
Include dependency graph for apr_arch_inherit.h:

Go to the source code of this file.

Macros

#define APR_INHERIT   (1 << 24) /* Must not conflict with other bits */
 
#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)
 
#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)
 

Macro Definition Documentation

◆ APR_IMPLEMENT_INHERIT_SET

#define APR_IMPLEMENT_INHERIT_SET (   name,
  flag,
  pool,
  cleanup 
)
Value:
apr_status_t apr_##name##_inherit_set(apr_##name##_t *the##name) \
{ \
if (the##name->flag & APR_FOPEN_NOCLEANUP) \
return APR_EINVAL; \
if (!(the##name->flag & APR_INHERIT)) { \
int flags = fcntl(the##name->name##des, F_GETFD); \
if (flags == -1) \
return errno; \
flags &= ~(FD_CLOEXEC); \
if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \
return errno; \
the##name->flag |= APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
cleanup, apr_pool_cleanup_null); \
} \
return APR_SUCCESS; \
}
#define APR_EINVAL
Definition: apr_errno.h:717
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1458
const char * name
Definition: mod_dav.h:805
apr_status_t apr_pool_cleanup_null(void *data)
#define APR_SUCCESS
Definition: apr_errno.h:225
int apr_status_t
Definition: apr_errno.h:44
#define APR_FOPEN_NOCLEANUP
Definition: apr_file_io.h:74
#define APR_INHERIT
Definition: apr_arch_inherit.h:22
APR_DECLARE_DATA int errno
Definition: apr_private.h:126

◆ APR_IMPLEMENT_INHERIT_UNSET

#define APR_IMPLEMENT_INHERIT_UNSET (   name,
  flag,
  pool,
  cleanup 
)
Value:
apr_status_t apr_##name##_inherit_unset(apr_##name##_t *the##name) \
{ \
if (the##name->flag & APR_FOPEN_NOCLEANUP) \
return APR_EINVAL; \
if (the##name->flag & APR_INHERIT) { \
int flags; \
if ((flags = fcntl(the##name->name##des, F_GETFD)) == -1) \
return errno; \
flags |= FD_CLOEXEC; \
if (fcntl(the##name->name##des, F_SETFD, flags) == -1) \
return errno; \
the##name->flag &= ~APR_INHERIT; \
apr_pool_child_cleanup_set(the##name->pool, \
(void *)the##name, \
cleanup, cleanup); \
} \
return APR_SUCCESS; \
}

◆ APR_INHERIT

#define APR_INHERIT   (1 << 24) /* Must not conflict with other bits */