diff options
author | jim <jim@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-23 23:28:49 +0000 |
---|---|---|
committer | jim <jim@13f79535-47bb-0310-9956-ffa450edef68> | 2000-08-23 23:28:49 +0000 |
commit | fcad2b43a371f6171f5066a0c851bb2378a37fb8 (patch) | |
tree | 97b873a584bad0518add745e9ca81355dd9c6e2b /threadproc | |
parent | 7a5629c3721583e99c409a2fcbead70ef055c37f (diff) | |
download | libapr-fcad2b43a371f6171f5066a0c851bb2378a37fb8.tar.gz |
We need to test specifically for setrlimit/getrlimit instead of
just the structure or the RLIMIT_* defines. Also, we should make
the API function unixd_set_rlimit() ``available'' even if it
doesn't do anything.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60512 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r-- | threadproc/unix/proc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c index 62ea3d770..6d7d0f5b0 100644 --- a/threadproc/unix/proc.c +++ b/threadproc/unix/proc.c @@ -225,10 +225,9 @@ apr_status_t apr_fork(apr_proc_t *proc, apr_pool_t *cont) return APR_INPARENT; } -#if APR_HAVE_STRUCT_RLIMIT -#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) static apr_status_t limit_proc(apr_procattr_t *attr) { +#if APR_HAVE_STRUCT_RLIMIT && APR_HAVE_SETRLIMIT #ifdef RLIMIT_CPU if (attr->limit_cpu != NULL) { if ((setrlimit(RLIMIT_CPU, attr->limit_cpu)) != 0) { @@ -262,10 +261,14 @@ static apr_status_t limit_proc(apr_procattr_t *attr) } } #endif +#else + /* + * Maybe make a note in error_log that setrlimit isn't supported?? + */ + +#endif return APR_SUCCESS; } -#endif -#endif apr_status_t apr_create_process(apr_proc_t *new, const char *progname, char *const args[], char **env, @@ -310,11 +313,9 @@ apr_status_t apr_create_process(apr_proc_t *new, const char *progname, apr_cleanup_for_exec(); -#if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) if ((status = limit_proc(attr)) != APR_SUCCESS) { return status; } -#endif if (attr->cmdtype == APR_SHELLCMD) { i = 0; |