00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "apr.h"
00018 #include "apr_private.h"
00019 #include "apr_thread_proc.h"
00020 #include "apr_file_io.h"
00021 #include "apr_arch_file_io.h"
00022
00023
00024 #if APR_HAVE_PTHREAD_H
00025 #include <pthread.h>
00026 #endif
00027 #ifdef HAVE_SYS_RESOURCE_H
00028 #include <sys/resource.h>
00029 #endif
00030 #if APR_HAVE_SIGNAL_H
00031 #include <signal.h>
00032 #endif
00033 #if APR_HAVE_STRING_H
00034 #include <string.h>
00035 #endif
00036 #if APR_HAVE_SYS_WAIT_H
00037 #include <sys/wait.h>
00038 #endif
00039 #if APR_HAVE_STRING_H
00040 #include <string.h>
00041 #endif
00042
00043
00044
00045 #ifndef THREAD_PROC_H
00046 #define THREAD_PROC_H
00047
00048 #define SHELL_PATH "/bin/sh"
00049
00050 #if APR_HAS_THREADS
00051
00052 struct apr_thread_t {
00053 apr_pool_t *pool;
00054 pthread_t *td;
00055 void *data;
00056 apr_thread_start_t func;
00057 apr_status_t exitval;
00058 };
00059
00060 struct apr_threadattr_t {
00061 apr_pool_t *pool;
00062 pthread_attr_t attr;
00063 };
00064
00065 struct apr_threadkey_t {
00066 apr_pool_t *pool;
00067 pthread_key_t key;
00068 };
00069
00070 struct apr_thread_once_t {
00071 pthread_once_t once;
00072 };
00073
00074 #endif
00075
00076 struct apr_procattr_t {
00077 apr_pool_t *pool;
00078 apr_file_t *parent_in;
00079 apr_file_t *child_in;
00080 apr_file_t *parent_out;
00081 apr_file_t *child_out;
00082 apr_file_t *parent_err;
00083 apr_file_t *child_err;
00084 char *currdir;
00085 apr_int32_t cmdtype;
00086 apr_int32_t detached;
00087 #ifdef RLIMIT_CPU
00088 struct rlimit *limit_cpu;
00089 #endif
00090 #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
00091 struct rlimit *limit_mem;
00092 #endif
00093 #ifdef RLIMIT_NPROC
00094 struct rlimit *limit_nproc;
00095 #endif
00096 #ifdef RLIMIT_NOFILE
00097 struct rlimit *limit_nofile;
00098 #endif
00099 apr_child_errfn_t *errfn;
00100 apr_int32_t errchk;
00101 apr_uid_t uid;
00102 apr_gid_t gid;
00103 };
00104
00105 #endif
00106