Update.
[glibc.git] / resource / sys / resource.h
blobe44193b326dd9e838355f14b7d2f1e8c544b17bc
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
22 #include <features.h>
24 /* Get the system-dependent definitions of structures and bit values. */
25 #include <bits/resource.h>
27 __BEGIN_DECLS
29 /* Put the soft and hard limits for RESOURCE in *RLIMITS.
30 Returns 0 if successful, -1 if not (and sets errno). */
31 #ifndef __USE_FILE_OFFSET64
32 extern int getrlimit __P ((enum __rlimit_resource __resource,
33 struct rlimit *__rlimits));
34 #else
35 # ifdef __REDIRECT
36 extern int __REDIRECT (getrlimit, __P ((enum __rlimit_resource __resource,
37 struct rlimit *__rlimits)),
38 getrlimit64);
39 # else
40 # define getrlimit getrlimit64
41 # endif
42 #endif
43 #ifdef __USE_LARGEFILE64
44 extern int getrlimit64 __P ((enum __rlimit_resource __resource,
45 struct rlimit64 *__rlimits));
46 #endif
48 /* Set the soft and hard limits for RESOURCE to *RLIMITS.
49 Only the super-user can increase hard limits.
50 Return 0 if successful, -1 if not (and sets errno). */
51 #ifndef __USE_FILE_OFFSET64
52 extern int setrlimit __P ((enum __rlimit_resource __resource,
53 __const struct rlimit *__rlimits));
54 #else
55 # ifdef __REDIRECT
56 extern int __REDIRECT (setrlimit, __P ((enum __rlimit_resource __resource,
57 __const struct rlimit *__rlimits)),
58 setrlimit64);
59 # else
60 # define setrlimit setrlimit64
61 # endif
62 #endif
63 #ifdef __USE_LARGEFILE64
64 extern int setrlimit64 __P ((enum __rlimit_resource __resource,
65 __const struct rlimit64 *__rlimits));
66 #endif
68 /* Return resource usage information on process indicated by WHO
69 and put it in *USAGE. Returns 0 for success, -1 for failure. */
70 extern int getrusage __P ((enum __rusage_who __who, struct rusage *__usage));
72 /* Return the highest priority of any process specified by WHICH and WHO
73 (see above); if WHO is zero, the current process, process group, or user
74 (as specified by WHO) is used. A lower priority number means higher
75 priority. Priorities range from PRIO_MIN to PRIO_MAX (above). */
76 extern int getpriority __P ((enum __priority_which __which, int __who));
78 /* Set the priority of all processes specified by WHICH and WHO (see above)
79 to PRIO. Returns 0 on success, -1 on errors. */
80 extern int setpriority __P ((enum __priority_which __which, int __who,
81 int __prio));
83 __END_DECLS
85 #endif /* sys/resource.h */