From: Jim Jagielski Date: Wed, 23 Aug 2000 23:28:54 +0000 (+0000) Subject: We need to test specifically for setrlimit/getrlimit instead of X-Git-Tag: APACHE_2_0_ALPHA_7~220 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e1e8ebb73d441742101eb89c7a10489225cda64;p=apache 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: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86143 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/os/unix/unixd.c b/os/unix/unixd.c index 15081f0d5b..c2d0f40134 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -339,10 +339,10 @@ void unixd_siglist_init(void) } #endif /* NEED_AP_SYS_SIGLIST */ -#if defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS) API_EXPORT(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, const char *arg, const char * arg2, int type) { +#if (defined(RLIMIT_CPU) || defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_NPROC) || defined(RLIMIT_AS)) && APR_HAVE_STRUCT_RLIMIT && APR_HAVE_GETRLIMIT char *str; struct rlimit *limit; /* If your platform doesn't define rlim_t then typedef it in ap_config.h */ @@ -392,6 +392,10 @@ API_EXPORT(void) unixd_set_rlimit(cmd_parms *cmd, struct rlimit **plimit, limit->rlim_max = max; } } -} +#else + + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, cmd->server, + "Platform does not support rlimit for %s", cmd->cmd->name); #endif +}