@@ -24,12 +24,15 @@ cfg_if! {
24
24
}
25
25
26
26
libc_enum ! {
27
+ /// Types of process resources.
28
+ ///
27
29
/// The Resource enum is platform dependent. Check different platform
28
- /// manuals for more details. Some platform links has been provided for
29
- /// earier reference (non-exhaustive).
30
+ /// manuals for more details. Some platform links have been provided for
31
+ /// easier reference (non-exhaustive).
30
32
///
31
33
/// * [Linux](https://man7.org/linux/man-pages/man2/getrlimit.2.html)
32
34
/// * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=setrlimit)
35
+ /// * [NetBSD](https://man.netbsd.org/setrlimit.2)
33
36
34
37
// linux-gnu uses u_int as resource enum, which is implemented in libc as
35
38
// well.
@@ -49,11 +52,7 @@ libc_enum! {
49
52
) , repr( i32 ) ) ]
50
53
#[ non_exhaustive]
51
54
pub enum Resource {
52
- #[ cfg( not( any(
53
- target_os = "freebsd" ,
54
- target_os = "netbsd" ,
55
- target_os = "openbsd"
56
- ) ) ) ]
55
+ #[ cfg( not( any( target_os = "freebsd" , target_os = "netbsd" , target_os = "openbsd" ) ) ) ]
57
56
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
58
57
/// The maximum amount (in bytes) of virtual memory the process is
59
58
/// allowed to map.
@@ -83,7 +82,13 @@ libc_enum! {
83
82
/// this process may establish.
84
83
RLIMIT_LOCKS ,
85
84
86
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "openbsd" , target_os = "linux" ) ) ]
85
+ #[ cfg( any(
86
+ target_os = "android" ,
87
+ target_os = "freebsd" ,
88
+ target_os = "openbsd" ,
89
+ target_os = "linux" ,
90
+ target_os = "netbsd"
91
+ ) ) ]
87
92
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
88
93
/// The maximum size (in bytes) which a process may lock into memory
89
94
/// using the mlock(2) system call.
@@ -101,7 +106,13 @@ libc_enum! {
101
106
/// setpriority or nice.
102
107
RLIMIT_NICE ,
103
108
104
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "openbsd" , target_os = "linux" ) ) ]
109
+ #[ cfg( any(
110
+ target_os = "android" ,
111
+ target_os = "freebsd" ,
112
+ target_os = "netbsd" ,
113
+ target_os = "openbsd" ,
114
+ target_os = "linux" ,
115
+ ) ) ]
105
116
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
106
117
/// The maximum number of simultaneous processes for this user id.
107
118
RLIMIT_NPROC ,
@@ -112,7 +123,12 @@ libc_enum! {
112
123
/// create.
113
124
RLIMIT_NPTS ,
114
125
115
- #[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "openbsd" , target_os = "linux" ) ) ]
126
+ #[ cfg( any( target_os = "android" ,
127
+ target_os = "freebsd" ,
128
+ target_os = "netbsd" ,
129
+ target_os = "openbsd" ,
130
+ target_os = "linux" ,
131
+ ) ) ]
116
132
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
117
133
/// When there is memory pressure and swap is available, prioritize
118
134
/// eviction of a process' resident pages beyond this amount (in bytes).
0 commit comments