]> granicus.if.org Git - apache/commitdiff
We need to test specifically for setrlimit/getrlimit instead of
authorJim Jagielski <jim@apache.org>
Wed, 23 Aug 2000 23:28:54 +0000 (23:28 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 23 Aug 2000 23:28:54 +0000 (23:28 +0000)
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

os/unix/unixd.c

index 15081f0d5bed9bad8b0c072b6a21321cfc8c6c9f..c2d0f40134dfe4c66cb27e45f240b4f1c1858d7d 100644 (file)
@@ -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
+}