modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/i386-linux-gnu/sys/resource.h (about)

     1  /* Copyright (C) 1992-2018 Free Software Foundation, Inc.
     2     This file is part of the GNU C Library.
     3  
     4     The GNU C Library is free software; you can redistribute it and/or
     5     modify it under the terms of the GNU Lesser General Public
     6     License as published by the Free Software Foundation; either
     7     version 2.1 of the License, or (at your option) any later version.
     8  
     9     The GNU C Library is distributed in the hope that it will be useful,
    10     but WITHOUT ANY WARRANTY; without even the implied warranty of
    11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12     Lesser General Public License for more details.
    13  
    14     You should have received a copy of the GNU Lesser General Public
    15     License along with the GNU C Library; if not, see
    16     <http://www.gnu.org/licenses/>.  */
    17  
    18  #ifndef	_SYS_RESOURCE_H
    19  #define	_SYS_RESOURCE_H	1
    20  
    21  #include <features.h>
    22  
    23  /* Get the system-dependent definitions of structures and bit values.  */
    24  #include <bits/resource.h>
    25  
    26  #ifndef __id_t_defined
    27  typedef __id_t id_t;
    28  # define __id_t_defined
    29  #endif
    30  
    31  __BEGIN_DECLS
    32  /* The X/Open standard defines that all the functions below must use
    33     `int' as the type for the first argument.  When we are compiling with
    34     GNU extensions we change this slightly to provide better error
    35     checking.  */
    36  #if defined __USE_GNU && !defined __cplusplus
    37  typedef enum __rlimit_resource __rlimit_resource_t;
    38  typedef enum __rusage_who __rusage_who_t;
    39  typedef enum __priority_which __priority_which_t;
    40  #else
    41  typedef int __rlimit_resource_t;
    42  typedef int __rusage_who_t;
    43  typedef int __priority_which_t;
    44  #endif
    45  
    46  /* Put the soft and hard limits for RESOURCE in *RLIMITS.
    47     Returns 0 if successful, -1 if not (and sets errno).  */
    48  #ifndef __USE_FILE_OFFSET64
    49  extern int getrlimit(__rlimit_resource_t __resource, struct rlimit *__rlimits) __THROW;
    50  #else
    51  # ifdef __REDIRECT_NTH
    52  extern int __REDIRECT_NTH(getrlimit, (__rlimit_resource_t __resource, struct rlimit * __rlimits), getrlimit64);
    53  # else
    54  #  define getrlimit getrlimit64
    55  # endif
    56  #endif
    57  #ifdef __USE_LARGEFILE64
    58  extern int getrlimit64(__rlimit_resource_t __resource, struct rlimit64 *__rlimits) __THROW;
    59  #endif
    60  
    61  /* Set the soft and hard limits for RESOURCE to *RLIMITS.
    62     Only the super-user can increase hard limits.
    63     Return 0 if successful, -1 if not (and sets errno).  */
    64  #ifndef __USE_FILE_OFFSET64
    65  extern int setrlimit(__rlimit_resource_t __resource, const struct rlimit *__rlimits) __THROW;
    66  #else
    67  # ifdef __REDIRECT_NTH
    68  extern int __REDIRECT_NTH(setrlimit, (__rlimit_resource_t __resource, const struct rlimit * __rlimits), setrlimit64);
    69  # else
    70  #  define setrlimit setrlimit64
    71  # endif
    72  #endif
    73  #ifdef __USE_LARGEFILE64
    74  extern int setrlimit64(__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) __THROW;
    75  #endif
    76  
    77  /* Return resource usage information on process indicated by WHO
    78     and put it in *USAGE.  Returns 0 for success, -1 for failure.  */
    79  extern int getrusage(__rusage_who_t __who, struct rusage *__usage) __THROW;
    80  
    81  /* Return the highest priority of any process specified by WHICH and WHO
    82     (see above); if WHO is zero, the current process, process group, or user
    83     (as specified by WHO) is used.  A lower priority number means higher
    84     priority.  Priorities range from PRIO_MIN to PRIO_MAX (above).  */
    85  extern int getpriority(__priority_which_t __which, id_t __who) __THROW;
    86  
    87  /* Set the priority of all processes specified by WHICH and WHO (see above)
    88     to PRIO.  Returns 0 on success, -1 on errors.  */
    89  extern int setpriority(__priority_which_t __which, id_t __who, int __prio) __THROW;
    90  
    91  __END_DECLS
    92  #endif				/* sys/resource.h  */