Add BIND 9.2.4rc7.
[dragonfly.git] / contrib / bind-9.2.4rc7 / lib / isc / include / isc / resource.h
blobbe0ae1c7e6b344c716dc3a49f842f7ea48d07f13
1 /*
2 * Copyright (C) 2004 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.4.2.1 2004/03/09 06:12:00 marka Exp $ */
20 #ifndef ISC_RESOURCE_H
21 #define ISC_RESOURCE_H 1
23 #include <isc/lang.h>
24 #include <isc/types.h>
26 #define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)ISC_UINT64_MAX)
28 ISC_LANG_BEGINDECLS
30 isc_result_t
31 isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value);
33 * Set the maximum limit for a system resource.
35 * Notes:
36 * If 'value' exceeds the maximum possible on the operating system,
37 * it is silently limited to that maximum -- or to "infinity", if
38 * the operating system has that concept. ISC_RESOURCE_UNLIMITED
39 * can be used to explicitly ask for the maximum.
41 * Requires:
42 * 'resource' is a valid member of the isc_resource_t enumeration.
44 * Returns:
45 * ISC_R_SUCCESS Success.
46 * ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
47 * ISC_R_NOPERM The calling process did not have adequate permission
48 * to change the resource limit.
51 isc_result_t
52 isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value);
54 * Get the maximum limit for a system resource.
56 * Notes:
57 * 'value' is set to the maximum limit.
59 * ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t.
61 * On many (all?) Unix systems, RLIM_INFINITY is a valid value that is
62 * significantly less than ISC_RESOURCE_UNLIMITED, but which in practice
63 * behaves the same.
65 * The current ISC libdns configuration file parser assigns a value
66 * of ISC_UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1
67 * for "default", the latter of which is supposed to represent "the
68 * limit that was in force when the server started". Since these are
69 * valid values in the middle of the range of isc_resourcevalue_t,
70 * there is the possibility for confusion over what exactly those
71 * particular values are supposed to represent in a particular context --
72 * discrete integral values or generalized concepts.
74 * Requires:
75 * 'resource' is a valid member of the isc_resource_t enumeration.
77 * Returns:
78 * ISC_R_SUCCESS Success.
79 * ISC_R_NOTIMPLEMENTED 'resource' is not a type known by the OS.
82 ISC_LANG_ENDDECLS
84 #endif /* ISC_RESOURCE_H */