1 /* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _SYS_RESOURCE_H
21 #define _SYS_RESOURCE_H 1
26 /* Get the system-dependent definitions of structures and bit values. */
27 #include <resourcebits.h>
29 /* Put the soft and hard limits for RESOURCE in *RLIMITS.
30 Returns 0 if successful, -1 if not (and sets errno). */
31 extern int __getrlimit
__P ((enum __rlimit_resource __resource
,
32 struct rlimit
*__rlimits
));
33 extern int getrlimit
__P ((enum __rlimit_resource __resource
,
34 struct rlimit
*__rlimits
));
36 /* Set the soft and hard limits for RESOURCE to *RLIMITS.
37 Only the super-user can increase hard limits.
38 Return 0 if successful, -1 if not (and sets errno). */
39 extern int setrlimit
__P ((enum __rlimit_resource __resource
,
40 struct rlimit
*__rlimits
));
42 /* Return resource usage information on process indicated by WHO
43 and put it in *USAGE. Returns 0 for success, -1 for failure. */
44 extern int __getrusage
__P ((enum __rusage_who __who
, struct rusage
*__usage
));
45 extern int getrusage
__P ((enum __rusage_who __who
, struct rusage
*__usage
));
47 /* Function depends on CMD:
48 1 = Return the limit on the size of a file, in units of 512 bytes.
49 2 = Set the limit on the size of a file to NEWLIMIT. Only the
50 super-user can increase the limit.
51 3 = Return the maximum possible address of the data segment.
52 4 = Return the maximum number of files that the calling process can open.
53 Returns -1 on errors. */
54 extern long int __ulimit
__P ((int __cmd
, long int __newlimit
));
55 extern long int ulimit
__P ((int __cmd
, long int __newlimit
));
57 /* Return the highest priority of any process specified by WHICH and WHO
58 (see above); if WHO is zero, the current process, process group, or user
59 (as specified by WHO) is used. A lower priority number means higher
60 priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
61 extern int getpriority
__P ((enum __priority_which __which
, int __who
));
63 /* Set the priority of all processes specified by WHICH and WHO (see above)
64 to PRIO. Returns 0 on success, -1 on errors. */
65 extern int setpriority
__P ((enum __priority_which __which
, int __who
,
71 #endif /* resource.h */