resource.c File Reference

#include <config.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <isc/platform.h>
#include <isc/resource.h>
#include <isc/result.h>
#include <isc/util.h>
#include "errno2result.h"

Go to the source code of this file.

Functions

static isc_result_t resource2rlim (isc_resource_t resource, int *rlim_resource)
isc_result_t isc_resource_setlimit (isc_resource_t resource, isc_resourcevalue_t value)
 Set the maximum limit for a system resource.
isc_result_t isc_resource_getlimit (isc_resource_t resource, isc_resourcevalue_t *value)
 Get the maximum limit for a system resource.
isc_result_t isc_resource_getcurlimit (isc_resource_t resource, isc_resourcevalue_t *value)
 Same as isc_resource_getlimit(), but returns the current (soft) limit.


Function Documentation

static isc_result_t resource2rlim ( isc_resource_t  resource,
int *  rlim_resource 
) [static]

Definition at line 42 of file resource.c.

References ISC_R_NOTIMPLEMENTED, ISC_R_RANGE, ISC_R_SUCCESS, isc_resource_coresize, isc_resource_cputime, isc_resource_datasize, isc_resource_filesize, isc_resource_lockedmemory, isc_resource_openfiles, isc_resource_processes, isc_resource_residentsize, isc_resource_stacksize, and REQUIRE.

Referenced by isc_resource_getcurlimit(), isc_resource_getlimit(), and isc_resource_setlimit().

isc_result_t isc_resource_setlimit ( isc_resource_t  resource,
isc_resourcevalue_t  value 
)

Set the maximum limit for a system resource.

Notes:

Requires: Returns:

Definition at line 105 of file resource.c.

References isc__errno2result, ISC_PLATFORM_RLIMITTYPE, ISC_R_SUCCESS, isc_resource_openfiles, ISC_RESOURCE_UNLIMITED, ISC_TF, and resource2rlim().

Referenced by ns_os_adjustnofile(), and set_limit().

isc_result_t isc_resource_getlimit ( isc_resource_t  resource,
isc_resourcevalue_t value 
)

Get the maximum limit for a system resource.

Notes:

Requires: Returns:

Definition at line 200 of file resource.c.

References INSIST, ISC_R_SUCCESS, and resource2rlim().

Referenced by setup().

isc_result_t isc_resource_getcurlimit ( isc_resource_t  resource,
isc_resourcevalue_t value 
)

Same as isc_resource_getlimit(), but returns the current (soft) limit.

Returns:

Definition at line 217 of file resource.c.

References INSIST, ISC_R_SUCCESS, and resource2rlim().

Referenced by isc__socketmgr_waitevents(), load_configuration(), and setup_watcher().


Generated on Tue Apr 28 17:41:19 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha