Commit 7999db42 authored by Mark Andrews's avatar Mark Andrews

2404. [port] hpux: files unlimited support.

parent 481e9b57
2404. [port] hpux: files unlimited support.
2403. [bug] TSIG context leak. [RT #18341]
2402. [port] Support Solaris 2.11 and over. [RT #18362]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: resource.c,v 1.19 2008/07/21 03:37:17 marka Exp $ */
/* $Id: resource.c,v 1.20 2008/07/28 22:36:36 marka Exp $ */
#include <config.h>
......@@ -32,6 +32,10 @@
#include <linux/fs.h> /* To get the large NR_OPEN. */
#endif
#ifdef __hpux
#include <sys/dyntune.h>
#endif
#include "errno2result.h"
static isc_result_t
......@@ -166,7 +170,25 @@ isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value) {
if (unixresult == 0)
return (ISC_R_SUCCESS);
}
#elif defined(__hpux)
if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
uint64_t maxfiles;
if (gettune("maxfiles_lim", &maxfiles) == 0) {
rl.rlim_cur = rl.rlim_max = maxfiles;
unixresult = setrlimit(unixresource, &rl);
if (unixresult == 0)
return (ISC_R_SUCCESS);
}
}
#endif
if (resource == isc_resource_openfiles && rlim_value == RLIM_INFINITY) {
if (getrlimit(unixresource, &rl) == 0) {
rl.rlim_cur = rl.rlim_max;
unixresult = setrlimit(unixresource, &rl);
if (unixresult == 0)
return (ISC_R_SUCCESS);
}
}
return (isc__errno2result(errno));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment