Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_arch_threadproc.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "apr.h"
18 #include "apr_private.h"
19 #include "apr_thread_proc.h"
20 #include "apr_file_io.h"
21 #include "apr_arch_file_io.h"
22 #include "apr_perms_set.h"
23 
24 /* System headers required for thread/process library */
25 #if APR_HAVE_PTHREAD_H
26 #include <pthread.h>
27 #endif
28 #ifdef HAVE_SYS_RESOURCE_H
29 #include <sys/resource.h>
30 #endif
31 #if APR_HAVE_SIGNAL_H
32 #include <signal.h>
33 #endif
34 #if APR_HAVE_STRING_H
35 #include <string.h>
36 #endif
37 #if APR_HAVE_SYS_WAIT_H
38 #include <sys/wait.h>
39 #endif
40 #if APR_HAVE_STRING_H
41 #include <string.h>
42 #endif
43 #ifdef HAVE_SCHED_H
44 #include <sched.h>
45 #endif
46 /* End System Headers */
47 
48 
49 #ifndef THREAD_PROC_H
50 #define THREAD_PROC_H
51 
52 #define SHELL_PATH "/bin/sh"
53 
54 #if APR_HAS_THREADS
55 
56 struct apr_thread_t {
58  pthread_t *td;
59  void *data;
62 };
63 
64 struct apr_threadattr_t {
66  pthread_attr_t attr;
67 };
68 
69 struct apr_threadkey_t {
71  pthread_key_t key;
72 };
73 
74 struct apr_thread_once_t {
75  pthread_once_t once;
76 };
77 
78 #endif
79 
85  const void *data;
86 };
87 
88 struct apr_procattr_t {
96  char *currdir;
99 #ifdef RLIMIT_CPU
100  struct rlimit *limit_cpu;
101 #endif
102 #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
103  struct rlimit *limit_mem;
104 #endif
105 #ifdef RLIMIT_NPROC
106  struct rlimit *limit_nproc;
107 #endif
108 #ifdef RLIMIT_NOFILE
109  struct rlimit *limit_nofile;
110 #endif
116 };
117 
118 #endif /* ! THREAD_PROC_H */
119 
apr_thread_start_t func
Definition: apr_arch_threadproc.h:46
apr_int32_t cmdtype
Definition: apr_arch_threadproc.h:85
APR Process Locking Routines.
struct apr_procattr_pscb_t * next
Definition: apr_arch_threadproc.h:82
apr_file_t * child_err
Definition: apr_arch_threadproc.h:83
Definition: apr_arch_file_io.h:107
apr_pool_t * pool
Definition: apr_arch_threadproc.h:51
apr_int32_t errchk
Definition: apr_arch_threadproc.h:112
void( apr_child_errfn_t)(apr_pool_t *proc, apr_status_t err, const char *description)
Definition: apr_thread_proc.h:184
apr_file_t * parent_err
Definition: apr_arch_threadproc.h:82
apr_pool_t * pool
Definition: apr_arch_threadproc.h:43
pthread_once_t once
Definition: apr_arch_threadproc.h:75
apr_perms_setfn_t * perms_set_fn
Definition: apr_arch_threadproc.h:83
apr_file_t * parent_in
Definition: apr_arch_threadproc.h:78
pthread_attr_t attr
Definition: apr_arch_threadproc.h:66
apr_int32_t detached
Definition: apr_arch_threadproc.h:86
uid_t apr_uid_t
Definition: apr_user.h:45
APR File I/O Handling.
void *(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
Definition: apr_thread_proc.h:208
apr_child_errfn_t * errfn
Definition: apr_arch_threadproc.h:111
Definition: apr_arch_threadproc.h:89
Definition: apr_arch_threadproc.h:81
apr_status_t exitval
Definition: apr_arch_threadproc.h:47
apr_fileperms_t perms
Definition: apr_arch_threadproc.h:84
apr_int32_t apr_fileperms_t
Definition: apr_file_info.h:125
apr_uid_t uid
Definition: apr_arch_threadproc.h:113
apr_file_t * child_in
Definition: apr_arch_threadproc.h:79
Definition: apr_arch_threadproc.h:42
apr_pool_t * pool
Definition: apr_arch_threadproc.h:58
APR Platform Definitions.
APR Thread and Process Library.
const void * data
Definition: apr_arch_threadproc.h:85
apr_gid_t gid
Definition: apr_arch_threadproc.h:114
void * data
Definition: apr_arch_threadproc.h:45
apr_pool_t * pool
Definition: apr_arch_threadproc.h:77
Definition: apr_arch_threadproc.h:50
gid_t apr_gid_t
Definition: apr_user.h:54
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
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
int apr_status_t
Definition: apr_errno.h:44
Definition: apr_arch_threadproc.h:76
apr_file_t * child_out
Definition: apr_arch_threadproc.h:81
char * currdir
Definition: apr_arch_threadproc.h:84
Definition: apr_arch_threadproc.h:57
apr_procattr_pscb_t * perms_set_callbacks
Definition: apr_arch_threadproc.h:115
pthread_t * td
Definition: apr_arch_threadproc.h:58
apr_file_t * parent_out
Definition: apr_arch_threadproc.h:80
pthread_key_t key
Definition: apr_arch_threadproc.h:71
int apr_int32_t
Definition: apr.h:333