2404. [port] hpux: files unlimited support.

This commit is contained in:
Mark Andrews
2008-07-28 22:36:36 +00:00
parent 481e9b573b
commit 7999db4215
2 changed files with 25 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
2404. [port] hpux: files unlimited support.
2403. [bug] TSIG context leak. [RT #18341]
2402. [port] Support Solaris 2.11 and over. [RT #18362]

View File

@@ -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));
}