1 /* Copyright (C) 1992, 1994, 1996, 1997 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
26 /* Get the system-dependent definitions of structures and bit values. */
27 #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 /* Function depends on CMD:
66 1 = Return the limit on the size of a file, in units of 512 bytes.
67 2 = Set the limit on the size of a file to NEWLIMIT. Only the
68 super-user can increase the limit.
69 3 = Return the maximum possible address of the data segment.
70 4 = Return the maximum number of files that the calling process can open.
71 Returns -1 on errors. */
72 extern long int __ulimit
__P ((int __cmd
, long int __newlimit
));
73 extern long int ulimit
__P ((int __cmd
, long int __newlimit
));
75 /* Return the highest priority of any process specified by WHICH and WHO
76 (see above); if WHO is zero, the current process, process group, or user
77 (as specified by WHO) is used. A lower priority number means higher
78 priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
79 extern int getpriority
__P ((enum __priority_which __which
, int __who
));
81 /* Set the priority of all processes specified by WHICH and WHO (see above)
82 to PRIO. Returns 0 on success, -1 on errors. */
83 extern int setpriority
__P ((enum __priority_which __which
, int __who
,
89 #endif /* sys/resource.h */