include signal.h to avoid thorny __sigcontext/sigcontext issues
[musl] / include / sys / resource.h
1 #ifndef _SYS_RESOURCE_H
2 #define _SYS_RESOURCE_H
3
4 #define __NEED_id_t
5 #define __NEED_time_t
6 #define __NEED_struct_timeval
7
8 #include <bits/alltypes.h>
9
10 typedef unsigned long long rlim_t;
11
12 struct rlimit
13 {
14         rlim_t rlim_cur;
15         rlim_t rlim_max;
16 };
17
18 struct rusage
19 {
20         struct timeval ru_utime;
21         struct timeval ru_stime;
22         /* linux extentions, but useful */
23         long    ru_maxrss;
24         long    ru_ixrss;
25         long    ru_idrss;
26         long    ru_isrss;
27         long    ru_minflt;
28         long    ru_majflt;
29         long    ru_nswap;
30         long    ru_inblock;
31         long    ru_oublock;
32         long    ru_msgsnd;
33         long    ru_msgrcv;
34         long    ru_nsignals;
35         long    ru_nvcsw;
36         long    ru_nivcsw;
37         /* room for more... */
38         long    __reserved[16];
39 };
40
41 int getrlimit (int, struct rlimit *);
42 int setrlimit (int, const struct rlimit *);
43 int getrusage (int, struct rusage *);
44
45 int getpriority (int, id_t);
46 int setpriority (int, id_t, int);
47
48 #define PRIO_PROCESS 0
49 #define PRIO_PGRP    1
50 #define PRIO_USER    2
51
52 #define RUSAGE_SELF     0
53 #define RUSAGE_CHILDREN 1
54
55 #define RLIM_INFINITY (~0ULL)
56 #define RLIM_SAVED_CUR RLIM_INFINITY
57 #define RLIM_SAVED_MAX RLIM_INFINITY
58
59 #define RLIMIT_CPU     0
60 #define RLIMIT_FSIZE   1
61 #define RLIMIT_DATA    2
62 #define RLIMIT_STACK   3
63 #define RLIMIT_CORE    4
64 #define RLIMIT_RSS     5
65 #define RLIMIT_NOFILE  7
66 #define RLIMIT_AS      9
67 #define RLIMIT_NPROC   6
68 #define RLIMIT_MEMLOCK 8
69 #define RLIMIT_LOCKS   10
70 #define RLIMIT_SIGPENDING 11
71 #define RLIMIT_MSGQUEUE 12
72 #define RLIMIT_NICE    13
73 #define RLIMIT_RTPRIO  14
74 #define RLIMIT_NLIMITS 15
75
76 #define RLIM_NLIMITS RLIMIT_NLIMITS
77
78
79 #endif