GME  13
apr_arch_threadproc.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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 /* System headers required for thread/process library */
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 #if HAVE_SCHED_H
00043 #include <sched.h>
00044 #endif
00045 /* End System Headers */
00046 
00047 
00048 #ifndef THREAD_PROC_H
00049 #define THREAD_PROC_H
00050 
00051 #define SHELL_PATH "/bin/sh"
00052 
00053 #if APR_HAS_THREADS
00054 
00055 struct apr_thread_t {
00056     apr_pool_t *pool;
00057     pthread_t *td;
00058     void *data;
00059     apr_thread_start_t func;
00060     apr_status_t exitval;
00061 };
00062 
00063 struct apr_threadattr_t {
00064     apr_pool_t *pool;
00065     pthread_attr_t attr;
00066 };
00067 
00068 struct apr_threadkey_t {
00069     apr_pool_t *pool;
00070     pthread_key_t key;
00071 };
00072 
00073 struct apr_thread_once_t {
00074     pthread_once_t once;
00075 };
00076 
00077 #endif
00078 
00079 struct apr_procattr_t {
00080     apr_pool_t *pool;
00081     apr_file_t *parent_in;
00082     apr_file_t *child_in;
00083     apr_file_t *parent_out;
00084     apr_file_t *child_out;
00085     apr_file_t *parent_err;
00086     apr_file_t *child_err;
00087     char *currdir;
00088     apr_int32_t cmdtype;
00089     apr_int32_t detached;
00090 #ifdef RLIMIT_CPU
00091     struct rlimit *limit_cpu;
00092 #endif
00093 #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
00094     struct rlimit *limit_mem;
00095 #endif
00096 #ifdef RLIMIT_NPROC
00097     struct rlimit *limit_nproc;
00098 #endif
00099 #ifdef RLIMIT_NOFILE
00100     struct rlimit *limit_nofile;
00101 #endif
00102     apr_child_errfn_t *errfn;
00103     apr_int32_t errchk;
00104     apr_uid_t   uid;
00105     apr_gid_t   gid;
00106 };
00107 
00108 #endif  /* ! THREAD_PROC_H */
00109