diff options
Diffstat (limited to 'srclib/apr/threadproc/netware')
-rw-r--r-- | srclib/apr/threadproc/netware/proc.c | 22 | ||||
-rw-r--r-- | srclib/apr/threadproc/netware/signals.c | 7 | ||||
-rw-r--r-- | srclib/apr/threadproc/netware/thread.c | 53 |
3 files changed, 47 insertions, 35 deletions
diff --git a/srclib/apr/threadproc/netware/proc.c b/srclib/apr/threadproc/netware/proc.c index 026ca6fd..d2404a82 100644 --- a/srclib/apr/threadproc/netware/proc.c +++ b/srclib/apr/threadproc/netware/proc.c @@ -26,7 +26,7 @@ */ static apr_file_t no_file = { NULL, -1, }; -apr_status_t apr_netware_proc_cleanup(void *theproc) +static apr_status_t apr_netware_proc_cleanup(void *theproc) { apr_proc_t *proc = theproc; int exit_int; @@ -448,8 +448,10 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } -APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32_t what, - struct rlimit *limit) +#if APR_HAVE_STRUCT_RLIMIT +APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, + apr_int32_t what, + struct rlimit *limit) { switch(what) { case APR_LIMIT_CPU: @@ -459,13 +461,15 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + case APR_LIMIT_MEM: -#if defined (RLIMIT_DATA) || defined (RLIMIT_VMEM) || defined(RLIMIT_AS) +#if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) attr->limit_mem = limit; break; #else return APR_ENOTIMPL; #endif + case APR_LIMIT_NPROC: #ifdef RLIMIT_NPROC attr->limit_nproc = limit; @@ -473,9 +477,19 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, apr_int32 #else return APR_ENOTIMPL; #endif + + case APR_LIMIT_NOFILE: +#ifdef RLIMIT_NOFILE + attr->limit_nofile = limit; + break; +#else + return APR_ENOTIMPL; +#endif + } return APR_SUCCESS; } +#endif /* APR_HAVE_STRUCT_RLIMIT */ APR_DECLARE(apr_status_t) apr_procattr_user_set(apr_procattr_t *attr, const char *username, diff --git a/srclib/apr/threadproc/netware/signals.c b/srclib/apr/threadproc/netware/signals.c index bc660af7..c744da5c 100644 --- a/srclib/apr/threadproc/netware/signals.c +++ b/srclib/apr/threadproc/netware/signals.c @@ -15,7 +15,6 @@ */ #include "apr_arch_threadproc.h" -#include <nks/thread.h> #include "apr_private.h" #include "apr_pools.h" #include "apr_signal.h" @@ -64,12 +63,12 @@ static void *signal_thread_func(void *signal_handler) return NULL; } +#if (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) APR_DECLARE(apr_status_t) apr_setup_signal_thread(void) { - int rv = 0; - - return rv; + return 0; } +#endif /* (APR_HAVE_SIGWAIT || APR_HAVE_SIGSUSPEND) */ APR_DECLARE(apr_status_t) apr_signal_block(int signum) { diff --git a/srclib/apr/threadproc/netware/thread.c b/srclib/apr/threadproc/netware/thread.c index 4b5d930a..e1a46e6e 100644 --- a/srclib/apr/threadproc/netware/thread.c +++ b/srclib/apr/threadproc/netware/thread.c @@ -41,7 +41,7 @@ apr_status_t apr_threadattr_create(apr_threadattr_t **new, apr_status_t apr_threadattr_detach_set(apr_threadattr_t *attr,apr_int32_t on) { attr->detach = on; - return APR_SUCCESS; + return APR_SUCCESS; } apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) @@ -71,21 +71,21 @@ static void *dummy_worker(void *opaque) } apr_status_t apr_thread_create(apr_thread_t **new, - apr_threadattr_t *attr, - apr_thread_start_t func, - void *data, - apr_pool_t *pool) + apr_threadattr_t *attr, + apr_thread_start_t func, + void *data, + apr_pool_t *pool) { apr_status_t stat; long flags = NX_THR_BIND_CONTEXT; - char threadName[NX_MAX_OBJECT_NAME_LEN+1]; + char threadName[NX_MAX_OBJECT_NAME_LEN+1]; size_t stack_size = APR_DEFAULT_STACK_SIZE; if (attr && attr->thread_name) { strncpy (threadName, attr->thread_name, NX_MAX_OBJECT_NAME_LEN); } else { - sprintf(threadName, "APR_thread %04ld", ++thread_count); + sprintf(threadName, "APR_thread %04ld", ++thread_count); } /* An original stack size of 0 will allow NXCreateThread() to @@ -117,27 +117,26 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->ctx = NXContextAlloc( - /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, - /* void *arg */ (*new), - /* int priority */ NX_PRIO_MED, - /* NXSize_t stackSize */ stack_size, - /* long flags */ NX_CTX_NORMAL, - /* int *error */ &stat); - - - stat = NXContextSetName( - /* NXContext_t ctx */ (*new)->ctx, - /* const char *name */ threadName); - - stat = NXThreadCreate( - /* NXContext_t context */ (*new)->ctx, - /* long flags */ flags, - /* NXThreadId_t *thread_id */ &(*new)->td); - - if(stat==0) - return APR_SUCCESS; + /* void(*start_routine)(void *arg) */ (void (*)(void *)) dummy_worker, + /* void *arg */ (*new), + /* int priority */ NX_PRIO_MED, + /* NXSize_t stackSize */ stack_size, + /* long flags */ NX_CTX_NORMAL, + /* int *error */ &stat); + + stat = NXContextSetName( + /* NXContext_t ctx */ (*new)->ctx, + /* const char *name */ threadName); + + stat = NXThreadCreate( + /* NXContext_t context */ (*new)->ctx, + /* long flags */ flags, + /* NXThreadId_t *thread_id */ &(*new)->td); + + if (stat == 0) + return APR_SUCCESS; - return(stat);// if error + return(stat); /* if error */ } apr_os_thread_t apr_os_thread_current() |