"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.16.7/lib/isc/include/isc/resource.h" (4 Sep 2020, 2859 Bytes) of package /linux/misc/dns/bind9/9.16.7/bind-9.16.7.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "resource.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef ISC_RESOURCE_H
   13 #define ISC_RESOURCE_H 1
   14 
   15 /*! \file isc/resource.h */
   16 
   17 #include <isc/lang.h>
   18 #include <isc/types.h>
   19 
   20 #define ISC_RESOURCE_UNLIMITED ((isc_resourcevalue_t)UINT64_MAX)
   21 
   22 ISC_LANG_BEGINDECLS
   23 
   24 isc_result_t
   25 isc_resource_setlimit(isc_resource_t resource, isc_resourcevalue_t value);
   26 /*%<
   27  * Set the maximum limit for a system resource.
   28  *
   29  * Notes:
   30  *\li   If 'value' exceeds the maximum possible on the operating system,
   31  *  it is silently limited to that maximum -- or to "infinity", if
   32  *  the operating system has that concept.  #ISC_RESOURCE_UNLIMITED
   33  *  can be used to explicitly ask for the maximum.
   34  *
   35  * Requires:
   36  *\li   'resource' is a valid member of the isc_resource_t enumeration.
   37  *
   38  * Returns:
   39  *\li   #ISC_R_SUCCESS  Success.
   40  *\li   #ISC_R_NOTIMPLEMENTED   'resource' is not a type known by the OS.
   41  *\li   #ISC_R_NOPERM   The calling process did not have adequate permission
   42  *          to change the resource limit.
   43  */
   44 
   45 isc_result_t
   46 isc_resource_getlimit(isc_resource_t resource, isc_resourcevalue_t *value);
   47 /*%<
   48  * Get the maximum limit for a system resource.
   49  *
   50  * Notes:
   51  *\li   'value' is set to the maximum limit.
   52  *
   53  *\li   #ISC_RESOURCE_UNLIMITED is the maximum value of isc_resourcevalue_t.
   54  *
   55  *\li   On many (all?) Unix systems, RLIM_INFINITY is a valid value that is
   56  *  significantly less than #ISC_RESOURCE_UNLIMITED, but which in practice
   57  *  behaves the same.
   58  *
   59  *\li   The current ISC libdns configuration file parser assigns a value
   60  *  of UINT32_MAX for a size_spec of "unlimited" and ISC_UNIT32_MAX - 1
   61  *  for "default", the latter of which is supposed to represent "the
   62  *  limit that was in force when the server started".  Since these are
   63  *  valid values in the middle of the range of isc_resourcevalue_t,
   64  *  there is the possibility for confusion over what exactly those
   65  *  particular values are supposed to represent in a particular context --
   66  *  discrete integral values or generalized concepts.
   67  *
   68  * Requires:
   69  *\li   'resource' is a valid member of the isc_resource_t enumeration.
   70  *
   71  * Returns:
   72  *\li   #ISC_R_SUCCESS      Success.
   73  *\li   #ISC_R_NOTIMPLEMENTED   'resource' is not a type known by the OS.
   74  */
   75 
   76 isc_result_t
   77 isc_resource_getcurlimit(isc_resource_t resource, isc_resourcevalue_t *value);
   78 /*%<
   79  * Same as isc_resource_getlimit(), but returns the current (soft) limit.
   80  *
   81  * Returns:
   82  *\li   #ISC_R_SUCCESS      Success.
   83  *\li   #ISC_R_NOTIMPLEMENTED   'resource' is not a type known by the OS.
   84  */
   85 
   86 ISC_LANG_ENDDECLS
   87 
   88 #endif /* ISC_RESOURCE_H */