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  int detached;
63 };
64 
65 struct apr_threadattr_t {
67  pthread_attr_t attr;
68 };
69 
70 struct apr_threadkey_t {
72  pthread_key_t key;
73 };
74 
75 struct apr_thread_once_t {
76  pthread_once_t once;
77 };
78 
79 #endif
80 
86  const void *data;
87 };
88 
89 struct apr_procattr_t {
97  char *currdir;
100 #ifdef RLIMIT_CPU
101  struct rlimit *limit_cpu;
102 #endif
103 #if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS)
104  struct rlimit *limit_mem;
105 #endif
106 #ifdef RLIMIT_NPROC
107  struct rlimit *limit_nproc;
108 #endif
109 #ifdef RLIMIT_NOFILE
110  struct rlimit *limit_nofile;
111 #endif
117 };
118 
119 #endif /* ! THREAD_PROC_H */
120 
apr_thread_start_t func
Definition: apr_arch_threadproc.h:46
apr_int32_t cmdtype
Definition: apr_arch_threadproc.h:86
APR Process Locking Routines.
struct apr_procattr_pscb_t * next
Definition: apr_arch_threadproc.h:83
apr_file_t * child_err
Definition: apr_arch_threadproc.h:84
Definition: apr_arch_file_io.h:107
apr_pool_t * pool
Definition: apr_arch_threadproc.h:52
apr_int32_t errchk
Definition: apr_arch_threadproc.h:113
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:83
apr_pool_t * pool
Definition: apr_arch_threadproc.h:43
pthread_once_t once
Definition: apr_arch_threadproc.h:76
apr_perms_setfn_t * perms_set_fn
Definition: apr_arch_threadproc.h:84
apr_file_t * parent_in
Definition: apr_arch_threadproc.h:79
pthread_attr_t attr
Definition: apr_arch_threadproc.h:67
apr_int32_t detached
Definition: apr_arch_threadproc.h:87
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:112
Definition: apr_arch_threadproc.h:90
Definition: apr_arch_threadproc.h:82
apr_status_t exitval
Definition: apr_arch_threadproc.h:47
apr_fileperms_t perms
Definition: apr_arch_threadproc.h:85
apr_int32_t apr_fileperms_t
Definition: apr_file_info.h:125
apr_uid_t uid
Definition: apr_arch_threadproc.h:114
apr_file_t * child_in
Definition: apr_arch_threadproc.h:80
Definition: apr_arch_threadproc.h:42
apr_pool_t * pool
Definition: apr_arch_threadproc.h:59
APR Platform Definitions.
APR Thread and Process Library.
const void * data
Definition: apr_arch_threadproc.h:86
apr_gid_t gid
Definition: apr_arch_threadproc.h:115
void * data
Definition: apr_arch_threadproc.h:45
apr_pool_t * pool
Definition: apr_arch_threadproc.h:78
Definition: apr_arch_threadproc.h:51
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
int detached
Definition: apr_arch_threadproc.h:48
Definition: apr_arch_threadproc.h:77
apr_file_t * child_out
Definition: apr_arch_threadproc.h:82
char * currdir
Definition: apr_arch_threadproc.h:85
Definition: apr_arch_threadproc.h:58
apr_procattr_pscb_t * perms_set_callbacks
Definition: apr_arch_threadproc.h:116
pthread_t * td
Definition: apr_arch_threadproc.h:58
apr_file_t * parent_out
Definition: apr_arch_threadproc.h:81
pthread_key_t key
Definition: apr_arch_threadproc.h:72
int apr_int32_t
Definition: apr.h:346