fix misplaced indention in sys/procfs.h
[musl.git] / include / sys / resource.h
blob6f22a2e780e23ef85ce1a399c0dcb7ba9c42267a
1 #ifndef _SYS_RESOURCE_H
2 #define _SYS_RESOURCE_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #include <features.h>
9 #include <sys/time.h>
11 #define __NEED_id_t
13 #ifdef _GNU_SOURCE
14 #define __NEED_pid_t
15 #endif
17 #include <bits/alltypes.h>
18 #include <bits/resource.h>
20 typedef unsigned long long rlim_t;
22 struct rlimit
24 rlim_t rlim_cur;
25 rlim_t rlim_max;
28 struct rusage
30 struct timeval ru_utime;
31 struct timeval ru_stime;
32 /* linux extentions, but useful */
33 long ru_maxrss;
34 long ru_ixrss;
35 long ru_idrss;
36 long ru_isrss;
37 long ru_minflt;
38 long ru_majflt;
39 long ru_nswap;
40 long ru_inblock;
41 long ru_oublock;
42 long ru_msgsnd;
43 long ru_msgrcv;
44 long ru_nsignals;
45 long ru_nvcsw;
46 long ru_nivcsw;
47 /* room for more... */
48 long __reserved[16];
51 int getrlimit (int, struct rlimit *);
52 int setrlimit (int, const struct rlimit *);
53 int getrusage (int, struct rusage *);
55 int getpriority (int, id_t);
56 int setpriority (int, id_t, int);
58 #ifdef _GNU_SOURCE
59 int prlimit(pid_t, int, const struct rlimit *, struct rlimit *);
60 #define prlimit64 prlimit
61 #endif
63 #define PRIO_MIN (-20)
64 #define PRIO_MAX 20
66 #define PRIO_PROCESS 0
67 #define PRIO_PGRP 1
68 #define PRIO_USER 2
70 #define RUSAGE_SELF 0
71 #define RUSAGE_CHILDREN (-1)
72 #define RUSAGE_THREAD 1
74 #define RLIM_INFINITY (~0ULL)
75 #define RLIM_SAVED_CUR RLIM_INFINITY
76 #define RLIM_SAVED_MAX RLIM_INFINITY
78 #define RLIMIT_CPU 0
79 #define RLIMIT_FSIZE 1
80 #define RLIMIT_DATA 2
81 #define RLIMIT_STACK 3
82 #define RLIMIT_CORE 4
83 #ifndef RLIMIT_RSS
84 #define RLIMIT_RSS 5
85 #define RLIMIT_NPROC 6
86 #define RLIMIT_NOFILE 7
87 #define RLIMIT_MEMLOCK 8
88 #define RLIMIT_AS 9
89 #endif
90 #define RLIMIT_LOCKS 10
91 #define RLIMIT_SIGPENDING 11
92 #define RLIMIT_MSGQUEUE 12
93 #define RLIMIT_NICE 13
94 #define RLIMIT_RTPRIO 14
95 #define RLIMIT_NLIMITS 15
97 #define RLIM_NLIMITS RLIMIT_NLIMITS
99 #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE)
100 #define RLIM64_INFINITY RLIM_INFINITY
101 #define RLIM64_SAVED_CUR RLIM_SAVED_CUR
102 #define RLIM64_SAVED_MAX RLIM_SAVED_MAX
103 #define getrlimit64 getrlimit
104 #define setrlimit64 setrlimit
105 #define rlimit64 rlimit
106 #define rlim64_t rlim_t
107 #endif
109 #ifdef __cplusplus
111 #endif
113 #endif