2 * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2000, 2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
18 /* $Id: resource.h,v 1.5.18.2 2005/04/29 00:17:02 marka Exp $ */
20 #ifndef ISC_RESOURCE_H
21 #define ISC_RESOURCE_H 1
26 #include <isc/types.h>
28 #define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX)
33 isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value);
35 * Set the maximum limit for a system resource.
38 *\li If 'value' exceeds the maximum possible on the operating system,
39 * it is silently limited to that maximum -- or to "infinity", if
40 * the operating system has that concept. #ISC_RESOURCE_UNLIMITED
41 * can be used to explicitly ask for the maximum.
44 *\li 'resource' is a valid member of the isc_resource_t enumeration.
47 *\li #ISC_R_SUCCESS Success.
48 *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
49 *\li #ISC_R_NOPERM The calling process did not have adequate permission
50 * to change the resource limit.
54 isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value);
56 * Get the maximum limit for a system resource.
59 *\li 'value' is set to the maximum limit.
61 *\li #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t.
63 *\li On many (all?) Unix systems, RLIM_INFINITY is a valid value that is
64 * significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice
67 *\li The current ISC libdns configuration file parser assigns a value
68 * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1
69 * for "default", the latter of which is supposed to represent "the
70 * limit that was in force when the server started". Since these are
71 * valid values in the middle of the range of isc_resourcevalue_t,
72 * there is the possibility for confusion over what exactly those
73 * particular values are supposed to represent in a particular context --
74 * discrete integral values or generalized concepts.
77 *\li 'resource' is a valid member of the isc_resource_t enumeration.
80 *\li #ISC_R_SUCCESS Success.
81 *\li #ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
86 #endif /* ISC_RESOURCE_H */