diff options
-rw-r--r-- | threadproc/netware/proc.c | 20 | ||||
-rw-r--r-- | threadproc/unix/proc.c | 5 |
2 files changed, 21 insertions, 4 deletions
diff --git a/threadproc/netware/proc.c b/threadproc/netware/proc.c index 026ca6fd7..533d774e1 100644 --- a/threadproc/netware/proc.c +++ b/threadproc/netware/proc.c @@ -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/threadproc/unix/proc.c b/threadproc/unix/proc.c index 283706cfb..b5e4dd47c 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -667,6 +667,7 @@ APR_DECLARE(apr_status_t) apr_proc_wait(apr_proc_t *proc, return errno; } +#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) @@ -681,7 +682,7 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, #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 @@ -708,3 +709,5 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr, return APR_SUCCESS; } +#endif /* APR_HAVE_STRUCT_RLIMIT */ + |