17 #ifndef APR_THREAD_PROC_H
18 #define APR_THREAD_PROC_H
31 #if APR_HAVE_STRUCT_RLIMIT
33 #include <sys/resource.h>
73 #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT)
75 #define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL)
77 #define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE)
82 #define APR_FULL_BLOCK 1
84 #define APR_FULL_NONBLOCK 2
86 #define APR_PARENT_BLOCK 3
88 #define APR_CHILD_BLOCK 4
93 #define APR_READ_BLOCK 3
95 #define APR_WRITE_BLOCK 4
100 #define APR_NO_FILE 8
103 #define APR_LIMIT_CPU 0
105 #define APR_LIMIT_MEM 1
107 #define APR_LIMIT_NPROC 2
109 #define APR_LIMIT_NOFILE 3
115 #define APR_OC_REASON_DEATH 0
117 #define APR_OC_REASON_UNWRITABLE 1
118 #define APR_OC_REASON_RESTART 2
122 #define APR_OC_REASON_UNREGISTER 3
125 #define APR_OC_REASON_LOST 4
127 #define APR_OC_REASON_RUNNING 5
143 #if APR_HAS_PROC_INVOKED || defined(DOXYGEN)
153 #if defined(WIN32) || defined(DOXYGEN)
175 const char *description);
217 #if defined(__cplusplus) && __cplusplus >= 201103L
218 #define APR_THREAD_LOCAL thread_local
219 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112 && \
220 (!defined(__GNUC__) || \
221 __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
222 #define APR_THREAD_LOCAL _Thread_local
223 #elif defined(__GNUC__)
224 #define APR_THREAD_LOCAL __thread
225 #elif defined(WIN32) && defined(_MSC_VER)
226 #define APR_THREAD_LOCAL __declspec(thread)
229 #ifdef APR_THREAD_LOCAL
230 #define APR_HAS_THREAD_LOCAL 1
232 #define APR_HAS_THREAD_LOCAL 0
424 void (*dest)(
void *),
471 #define APR_HAS_THREAD_LOCAL 0
586 #if APR_HAVE_STRUCT_RLIMIT
601 struct rlimit *limit);
652 const char *username,
653 const char *password);
661 const char *groupname);
705 const char *progname,
706 const char *
const *args,
707 const char *
const *env,
773 #define APR_PROC_DETACH_FOREGROUND 0
774 #define APR_PROC_DETACH_DAEMONIZE 1
881 #if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2)
APR Platform Definitions.
APR Process Locking Routines.
dav_buffer apr_size_t size
Definition: mod_dav.h:461
const dav_resource dav_prop_insert what
Definition: mod_dav.h:1095
int status
Definition: mod_dav.h:141
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
dav_error * err
Definition: mod_dav.h:203
const char * name
Definition: mod_dav.h:805
int apr_status_t
Definition: apr_errno.h:44
apr_int32_t apr_fileperms_t
Definition: apr_file_info.h:125
apr_status_t() apr_perms_setfn_t(void *object, apr_fileperms_t perms, apr_uid_t uid, apr_gid_t gid)
Definition: apr_perms_set.h:42
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_status_t apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow)
apr_status_t apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace)
apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t(*cleanup)(void *), apr_threadkey_t *threadkey)
void apr_proc_other_child_unregister(void *data)
apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd)
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
void() apr_child_errfn_t(apr_pool_t *proc, apr_status_t err, const char *description)
Definition: apr_thread_proc.h:174
apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key)
apr_status_t apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk)
apr_status_t apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in)
apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err)
apr_status_t apr_signal_thread(int(*signal_handler)(int signum))
apr_status_t apr_threadattr_guardsize_set(apr_threadattr_t *attr, apr_size_t guardsize)
apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key)
void apr_thread_exit(apr_thread_t *thd, apr_status_t retval) __attribute__((noreturn))
apr_status_t apr_procattr_group_set(apr_procattr_t *attr, const char *groupname)
apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach)
apr_status_t apr_proc_fork(apr_proc_t *proc, apr_pool_t *cont)
apr_kill_conditions_e
Definition: apr_thread_proc.h:200
apr_status_t apr_proc_kill(apr_proc_t *proc, int sig)
apr_status_t apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, struct rlimit *limit)
apr_status_t apr_proc_wait_all_procs(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow, apr_pool_t *p)
apr_status_t apr_thread_current_create(apr_thread_t **current, apr_threadattr_t *attr, apr_pool_t *pool)
apr_status_t apr_proc_detach(int daemonize)
apr_status_t apr_thread_name_set(const char *name, apr_thread_t *thread, apr_pool_t *pool)
apr_wait_how_e
Definition: apr_thread_proc.h:56
apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key)
apr_status_t apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p)
apr_status_t apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont)
apr_thread_t * apr_thread_current(void)
apr_status_t apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err)
apr_status_t apr_procattr_user_set(apr_procattr_t *attr, const char *username, const char *password)
void apr_proc_other_child_refresh(apr_other_child_rec_t *ocr, int reason)
apr_status_t apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize)
apr_status_t apr_setup_signal_thread(void)
apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on)
apr_status_t apr_proc_other_child_alert(apr_proc_t *proc, int reason, int status)
apr_status_t apr_thread_once(apr_thread_once_t *control, void(*func)(void))
apr_status_t apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont)
struct apr_proc_t apr_proc_t
apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir)
apr_status_t apr_threadattr_max_free_set(apr_threadattr_t *attr, apr_size_t size)
void *(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
Definition: apr_thread_proc.h:198
apr_status_t apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn)
apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t(*cleanup)(void *), apr_thread_t *thread)
apr_status_t apr_proc_create(apr_proc_t *new_proc, const char *progname, const char *const *args, const char *const *env, apr_procattr_t *attr, apr_pool_t *pool)
apr_status_t apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out)
apr_exit_why_e
Definition: apr_thread_proc.h:66
apr_status_t apr_thread_name_get(char **name, apr_thread_t *thread, apr_pool_t *pool)
apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void(*dest)(void *), apr_pool_t *cont)
void apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, apr_kill_conditions_e how)
void apr_thread_yield(void)
void apr_thread_current_after_fork(void)
void apr_proc_other_child_refresh_all(int reason)
apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
apr_status_t apr_procattr_perms_set_register(apr_procattr_t *attr, apr_perms_setfn_t *perms_set_fn, void *data, apr_fileperms_t perms)
APR_POOL_DECLARE_ACCESSOR(thread)
apr_status_t apr_thread_detach(apr_thread_t *thd)
apr_cmdtype_e
Definition: apr_thread_proc.h:46
apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey)
apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr)
apr_status_t apr_thread_create(apr_thread_t **new_thread, apr_threadattr_t *attr, apr_thread_start_t func, void *data, apr_pool_t *cont)
void apr_proc_other_child_register(apr_proc_t *proc, void(*maintenance)(int reason, void *, int status), void *data, apr_file_t *write_fd, apr_pool_t *p)
@ APR_KILL_AFTER_TIMEOUT
Definition: apr_thread_proc.h:205
@ APR_KILL_ONLY_ONCE
Definition: apr_thread_proc.h:207
@ APR_KILL_NEVER
Definition: apr_thread_proc.h:201
@ APR_JUST_WAIT
Definition: apr_thread_proc.h:206
@ APR_KILL_ALWAYS
Definition: apr_thread_proc.h:204
@ APR_NOWAIT
Definition: apr_thread_proc.h:58
@ APR_WAIT
Definition: apr_thread_proc.h:57
@ APR_PROC_SIGNAL_CORE
Definition: apr_thread_proc.h:69
@ APR_PROC_SIGNAL
Definition: apr_thread_proc.h:68
@ APR_PROC_EXIT
Definition: apr_thread_proc.h:67
@ APR_SHELLCMD
Definition: apr_thread_proc.h:47
@ APR_PROGRAM_ENV
Definition: apr_thread_proc.h:49
@ APR_PROGRAM_PATH
Definition: apr_thread_proc.h:50
@ APR_PROGRAM
Definition: apr_thread_proc.h:48
@ APR_SHELLCMD_ENV
Definition: apr_thread_proc.h:51
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_arch_file_io.h:107
Definition: apr_arch_misc.h:52
void * data
Definition: apr_arch_misc.h:57
void(* maintenance)(int, void *, int)
Definition: apr_arch_misc.h:56
apr_proc_t * proc
Definition: apr_arch_misc.h:55
Definition: apr_thread_proc.h:134
char * invoked
Definition: apr_thread_proc.h:151
pid_t pid
Definition: apr_thread_proc.h:136
apr_file_t * in
Definition: apr_thread_proc.h:138
HANDLE hproc
Definition: apr_thread_proc.h:160
apr_file_t * out
Definition: apr_thread_proc.h:140
apr_file_t * err
Definition: apr_thread_proc.h:142
Definition: apr_arch_threadproc.h:78
Definition: apr_arch_threadproc.h:91
Definition: apr_arch_threadproc.h:42
Definition: apr_arch_threadproc.h:51
Definition: apr_arch_threadproc.h:59