17 #ifndef APR_THREAD_PROC_H
18 #define APR_THREAD_PROC_H
30 #if APR_HAVE_STRUCT_RLIMIT
32 #include <sys/resource.h>
72 #define APR_PROC_CHECK_EXIT(x) (x & APR_PROC_EXIT)
74 #define APR_PROC_CHECK_SIGNALED(x) (x & APR_PROC_SIGNAL)
76 #define APR_PROC_CHECK_CORE_DUMP(x) (x & APR_PROC_SIGNAL_CORE)
81 #define APR_FULL_BLOCK 1
83 #define APR_FULL_NONBLOCK 2
85 #define APR_PARENT_BLOCK 3
87 #define APR_CHILD_BLOCK 4
92 #define APR_READ_BLOCK 3
94 #define APR_WRITE_BLOCK 4
102 #define APR_LIMIT_CPU 0
104 #define APR_LIMIT_MEM 1
106 #define APR_LIMIT_NPROC 2
108 #define APR_LIMIT_NOFILE 3
114 #define APR_OC_REASON_DEATH 0
116 #define APR_OC_REASON_UNWRITABLE 1
117 #define APR_OC_REASON_RESTART 2
121 #define APR_OC_REASON_UNREGISTER 3
124 #define APR_OC_REASON_LOST 4
126 #define APR_OC_REASON_RUNNING 5
142 #if APR_HAS_PROC_INVOKED || defined(DOXYGEN)
152 #if defined(WIN32) || defined(DOXYGEN)
174 const char *description);
243 apr_size_t stacksize);
256 apr_size_t guardsize);
346 void (*dest)(
void *),
416 apr_int32_t in, apr_int32_t out,
504 #if APR_HAVE_STRUCT_RLIMIT
519 struct rlimit *limit);
559 apr_int32_t addrspace);
570 const
char *username,
571 const
char *password);
579 const
char *groupname);
611 const
char *progname,
612 const
char * const *args,
613 const
char * const *env,
679 #define APR_PROC_DETACH_FOREGROUND 0
680 #define APR_PROC_DETACH_DAEMONIZE 1
708 void (*maintenance) (
int reason,
792 #if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) && !defined(OS2)
struct apr_threadattr_t apr_threadattr_t
Definition: apr_thread_proc.h:190
apr_status_t apr_procattr_io_set(apr_procattr_t *attr, apr_int32_t in, apr_int32_t out, apr_int32_t err)
Definition: apr_thread_proc.h:66
apr_status_t apr_thread_detach(apr_thread_t *thd)
void apr_proc_other_child_unregister(void *data)
struct apr_thread_t apr_thread_t
Definition: apr_thread_proc.h:187
apr_status_t apr_threadkey_private_get(void **new_mem, apr_threadkey_t *key)
Definition: apr_thread_proc.h:46
Definition: apr_thread_proc.h:56
apr_status_t apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize)
HANDLE hproc
Definition: apr_thread_proc.h:169
apr_status_t apr_proc_kill(apr_proc_t *proc, int sig)
apr_status_t apr_threadkey_private_delete(apr_threadkey_t *key)
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_status_t apr_procattr_group_set(apr_procattr_t *attr, const char *groupname)
apr_file_t * in
Definition: apr_thread_proc.h:147
Definition: apr_thread_proc.h:143
apr_file_t * out
Definition: apr_thread_proc.h:149
apr_status_t apr_thread_once(apr_thread_once_t *control, void(*func)(void))
apr_status_t apr_procattr_cmdtype_set(apr_procattr_t *attr, apr_cmdtype_e cmd)
apr_status_t apr_procattr_child_err_set(struct apr_procattr_t *attr, apr_file_t *child_err, apr_file_t *parent_err)
void *(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
Definition: apr_thread_proc.h:207
Definition: apr_thread_proc.h:216
apr_status_t apr_threadattr_guardsize_set(apr_threadattr_t *attr, apr_size_t guardsize)
void apr_pool_note_subprocess(apr_pool_t *a, apr_proc_t *proc, apr_kill_conditions_e how)
apr_status_t apr_procattr_child_out_set(struct apr_procattr_t *attr, apr_file_t *child_out, apr_file_t *parent_out)
apr_status_t apr_proc_wait(apr_proc_t *proc, int *exitcode, apr_exit_why_e *exitwhy, apr_wait_how_e waithow)
Definition: apr_thread_proc.h:57
Definition: apr_thread_proc.h:210
struct apr_file_t apr_file_t
Definition: apr_file_io.h:209
apr_status_t apr_thread_data_get(void **data, const char *key, apr_thread_t *thread)
apr_status_t apr_proc_other_child_alert(apr_proc_t *proc, int reason, int status)
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)
apr_status_t apr_thread_join(apr_status_t *retval, apr_thread_t *thd)
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)
char * invoked
Definition: apr_thread_proc.h:160
apr_status_t apr_procattr_error_check_set(apr_procattr_t *attr, apr_int32_t chk)
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)
struct apr_other_child_rec_t apr_other_child_rec_t
Definition: apr_thread_proc.h:202
apr_cmdtype_e
Definition: apr_thread_proc.h:45
Definition: apr_thread_proc.h:214
apr_status_t apr_procattr_detach_set(apr_procattr_t *attr, apr_int32_t detach)
struct apr_thread_once_t apr_thread_once_t
Definition: apr_thread_proc.h:196
apr_file_t * err
Definition: apr_thread_proc.h:151
Definition: apr_thread_proc.h:48
apr_kill_conditions_e
Definition: apr_thread_proc.h:209
APR Platform Definitions.
apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr)
void( apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, const char *description)
Definition: apr_thread_proc.h:183
apr_status_t apr_procattr_dir_set(apr_procattr_t *attr, const char *dir)
apr_exit_why_e
Definition: apr_thread_proc.h:65
apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr, apr_int32_t on)
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)
Definition: apr_thread_proc.h:50
Definition: apr_thread_proc.h:49
Definition: apr_thread_proc.h:213
apr_status_t apr_procattr_addrspace_set(apr_procattr_t *attr, apr_int32_t addrspace)
Definition: apr_thread_proc.h:68
void apr_thread_yield(void)
Definition: apr_thread_proc.h:47
pid_t pid
Definition: apr_thread_proc.h:145
apr_status_t apr_threadkey_private_set(void *priv, apr_threadkey_t *key)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
struct apr_procattr_t apr_procattr_t
Definition: apr_thread_proc.h:193
struct apr_threadkey_t apr_threadkey_t
Definition: apr_thread_proc.h:199
apr_status_t apr_proc_detach(int daemonize)
apr_status_t apr_procattr_create(apr_procattr_t **new_attr, apr_pool_t *cont)
apr_wait_how_e
Definition: apr_thread_proc.h:55
apr_status_t apr_procattr_child_in_set(struct apr_procattr_t *attr, apr_file_t *child_in, apr_file_t *parent_in)
struct apr_proc_t apr_proc_t
Definition: apr_thread_proc.h:67
apr_status_t apr_threadkey_private_create(apr_threadkey_t **key, void(*dest)(void *), apr_pool_t *cont)
apr_status_t apr_threadkey_data_get(void **data, const char *key, apr_threadkey_t *threadkey)
apr_status_t apr_thread_once_init(apr_thread_once_t **control, apr_pool_t *p)
#define APR_POOL_DECLARE_ACCESSOR(type)
Definition: apr_pools.h:81
apr_status_t apr_procattr_child_errfn_set(apr_procattr_t *attr, apr_child_errfn_t *errfn)
apr_status_t apr_threadkey_data_set(void *data, const char *key, apr_status_t(*cleanup)(void *), apr_threadkey_t *threadkey)
apr_status_t apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
void apr_proc_other_child_refresh_all(int reason)
apr_status_t apr_threadattr_create(apr_threadattr_t **new_attr, apr_pool_t *cont)
apr_status_t apr_thread_data_set(void *data, const char *key, apr_status_t(*cleanup)(void *), apr_thread_t *thread)
Definition: apr_thread_proc.h:215