1 /* Copyright (C) 1992, 1994, 1996, 1997, 1998 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
20 #define _SYS_RESOURCE_H 1
24 /* Get the system-dependent definitions of structures and bit values. */
25 #include <bits/resource.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 #ifndef __USE_FILE_OFFSET64
34 extern int getrlimit
__P ((enum __rlimit_resource __resource
,
35 struct rlimit
*__rlimits
));
37 extern int getrlimit
__P ((enum __rlimit_resource __resource
,
38 struct rlimit
*__rlimits
)) __asm__ ("getrlimit64");
40 #ifdef __USE_LARGEFILE64
41 extern int getrlimit64
__P ((enum __rlimit_resource __resource
,
42 struct rlimit64
*__rlimits
));
45 /* Set the soft and hard limits for RESOURCE to *RLIMITS.
46 Only the super-user can increase hard limits.
47 Return 0 if successful, -1 if not (and sets errno). */
48 #ifndef __USE_FILE_OFFSET64
49 extern int setrlimit
__P ((enum __rlimit_resource __resource
,
50 struct rlimit
*__rlimits
));
52 extern int setrlimit
__P ((enum __rlimit_resource __resource
,
53 struct rlimit
*__rlimits
)) __asm__ ("setrlimit64");
55 #ifdef __USE_LARGEFILE64
56 extern int setrlimit64
__P ((enum __rlimit_resource __resource
,
57 struct rlimit64
*__rlimits
));
60 /* Return resource usage information on process indicated by WHO
61 and put it in *USAGE. Returns 0 for success, -1 for failure. */
62 extern int __getrusage
__P ((enum __rusage_who __who
, struct rusage
*__usage
));
63 extern int getrusage
__P ((enum __rusage_who __who
, struct rusage
*__usage
));
65 /* Return the highest priority of any process specified by WHICH and WHO
66 (see above); if WHO is zero, the current process, process group, or user
67 (as specified by WHO) is used. A lower priority number means higher
68 priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
69 extern int getpriority
__P ((enum __priority_which __which
, int __who
));
71 /* Set the priority of all processes specified by WHICH and WHO (see above)
72 to PRIO. Returns 0 on success, -1 on errors. */
73 extern int setpriority
__P ((enum __priority_which __which
, int __who
,
78 #endif /* sys/resource.h */