]>
Commit | Line | Data |
---|---|---|
a887211b CV |
1 | /* sys/resource.h |
2 | ||
a887211b CV |
3 | This file is part of Cygwin. |
4 | ||
5 | This software is a copyrighted work licensed under the terms of the | |
6 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
7 | details. */ | |
8 | ||
1fd5e000 CF |
9 | #ifndef _SYS_RESOURCE_H_ |
10 | #define _SYS_RESOURCE_H_ | |
11 | ||
12 | #include <sys/time.h> | |
13 | ||
14 | #ifdef __cplusplus | |
15 | extern "C" { | |
16 | #endif | |
17 | ||
72c1491b CV |
18 | /* Used for get/setpriority */ |
19 | #define PRIO_PROCESS 0 | |
20 | #define PRIO_PGRP 1 | |
21 | #define PRIO_USER 2 | |
22 | ||
8a93913d CV |
23 | #define RLIMIT_CPU 0 /* CPU time in seconds */ |
24 | #define RLIMIT_FSIZE 1 /* Maximum filesize */ | |
25 | #define RLIMIT_DATA 2 /* max data size */ | |
26 | #define RLIMIT_STACK 3 /* max stack size */ | |
27 | #define RLIMIT_CORE 4 /* max core file size */ | |
28 | #define RLIMIT_NOFILE 5 /* max number of open files */ | |
29 | #define RLIMIT_OFILE RLIMIT_NOFILE /* BSD name */ | |
30 | #define RLIMIT_AS 6 /* address space (virt. memory) limit */ | |
31 | ||
44e6d951 | 32 | #define RLIMIT_NLIMITS 7 /* upper bound of RLIMIT_* defines */ |
83443511 | 33 | #define RLIM_NLIMITS RLIMIT_NLIMITS |
44e6d951 | 34 | |
61522196 | 35 | #define RLIM_INFINITY (~0UL) |
8a93913d CV |
36 | #define RLIM_SAVED_MAX RLIM_INFINITY |
37 | #define RLIM_SAVED_CUR RLIM_INFINITY | |
38 | ||
39 | typedef unsigned long rlim_t; | |
40 | ||
41 | struct rlimit { | |
42 | rlim_t rlim_cur; | |
43 | rlim_t rlim_max; | |
44 | }; | |
45 | ||
1fd5e000 CF |
46 | #define RUSAGE_SELF 0 /* calling process */ |
47 | #define RUSAGE_CHILDREN -1 /* terminated child processes */ | |
48 | ||
49 | struct rusage { | |
75a57bf0 | 50 | struct timeval ru_utime; /* user time used */ |
1fd5e000 CF |
51 | struct timeval ru_stime; /* system time used */ |
52 | long ru_maxrss; | |
53 | long ru_ixrss; /* XXX: 0 */ | |
54 | long ru_idrss; /* XXX: sum of rm_asrss */ | |
55 | long ru_isrss; /* XXX: 0 */ | |
9c510edc CF |
56 | long ru_minflt; /* any page faults not requiring I/O */ |
57 | long ru_majflt; /* any page faults requiring I/O */ | |
58 | long ru_nswap; /* swaps */ | |
59 | long ru_inblock; /* block input operations */ | |
60 | long ru_oublock; /* block output operations */ | |
61 | long ru_msgsnd; /* messages sent */ | |
62 | long ru_msgrcv; /* messages received */ | |
63 | long ru_nsignals; /* signals received */ | |
64 | long ru_nvcsw; /* voluntary context switches */ | |
65 | long ru_nivcsw; /* involuntary " */ | |
1fd5e000 CF |
66 | #define ru_last ru_nivcsw |
67 | }; | |
68 | ||
8a93913d CV |
69 | int getrlimit (int __resource, struct rlimit *__rlp); |
70 | int setrlimit (int __resource, const struct rlimit *__rlp); | |
71 | ||
1fd5e000 CF |
72 | int getrusage (int __who, struct rusage *__rusage); |
73 | ||
72c1491b CV |
74 | int getpriority (int which, id_t who); |
75 | int setpriority (int which, id_t who, int value); | |
76 | ||
1fd5e000 CF |
77 | #ifdef __cplusplus |
78 | } | |
79 | #endif | |
80 | ||
81 | #endif | |
82 |