summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2002-07-09 01:33:42 +0000
committerbrianp <brianp@13f79535-47bb-0310-9956-ffa450edef68>2002-07-09 01:33:42 +0000
commit3e3f236b53e2228578cff8f0806c07006953cbd4 (patch)
tree1c5c49cce6fda2915b39bedd5abc153a71e37b00 /threadproc
parent65871f0899a65e8c6d3cf8693d13a10882238eb9 (diff)
downloadlibapr-3e3f236b53e2228578cff8f0806c07006953cbd4.tar.gz
added support for changing the limit on file descriptors per process
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63591 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/unix/proc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/threadproc/unix/proc.c b/threadproc/unix/proc.c
index b0f41fd1f..f2b943495 100644
--- a/threadproc/unix/proc.c
+++ b/threadproc/unix/proc.c
@@ -260,6 +260,13 @@ static apr_status_t limit_proc(apr_procattr_t *attr)
}
}
#endif
+#ifdef RLIMIT_NOFILE
+ if (attr->limit_nofile != NULL) {
+ if ((setrlimit(RLIMIT_NOFILE, attr->limit_nofile)) != 0) {
+ return errno;
+ }
+ }
+#endif
#if defined(RLIMIT_AS)
if (attr->limit_mem != NULL) {
if ((setrlimit(RLIMIT_AS, attr->limit_mem)) != 0) {
@@ -528,6 +535,14 @@ APR_DECLARE(apr_status_t) apr_procattr_limit_set(apr_procattr_t *attr,
return APR_ENOTIMPL;
#endif
+ case APR_LIMIT_NOFILE:
+#ifdef RLIMIT_NOFILE
+ attr->limit_nofile = limit;
+ break;
+#else
+ return APR_ENOTIMPL;
+#endif
+
}
return APR_SUCCESS;