You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use libc::{self,rlimit, __rlimit_resource_t,RLIM_INFINITY};
5
5
pubuse libc::rlim_t;
6
6
7
7
use{Errno,Result};
8
8
9
+
#[cfg(target_os = "linux")]
9
10
libc_enum!{
10
11
/// A resource that limits apply to
11
12
#[repr(u32)]
12
13
pubenumResource{
13
14
// POSIX
14
-
/// This is the maximum size of the process's virtual memory (address space). The limit is specified in bytes, and is rounded down to the system page size.
15
+
/// This is the maximum size of the process's virtual memory (address space). The limit is
16
+
/// specified in bytes, and is rounded down to the system page size.
15
17
RLIMIT_AS,
16
-
/// This is the maximum size of a core file (see core(5)) in bytes that the process may dump.
18
+
/// This is the maximum size of a core file (see core(5)) in bytes that the process may
19
+
/// dump.
17
20
RLIMIT_CORE,
18
21
/// This is a limit, in seconds, on the amount of CPU time that the process can consume.
19
22
RLIMIT_CPU,
20
-
/// This is the maximum size of the process's data segment (initialized data, uninitialized data, and heap). The limit is specified in bytes, and is rounded down to the system page size.
23
+
/// This is the maximum size of the process's data segment (initialized data, uninitialized
24
+
/// data, and heap). The limit is specified in bytes, and is rounded down to the system
25
+
/// page size.
21
26
RLIMIT_DATA,
22
-
/// This is the maximum size in bytes of files that the process may create. Attempts to extend a file beyond this limit result in delivery of a SIGXFSZ signal.
27
+
/// This is the maximum size in bytes of files that the process may create. Attempts to
28
+
/// extend a file beyond this limit result in delivery of a SIGXFSZ signal.
23
29
RLIMIT_FSIZE,
24
-
/// This specifies a value one greater than the maximum file descriptor number that can be opened by this process.
30
+
/// This specifies a value one greater than the maximum file descriptor number that can be
31
+
/// opened by this process.
25
32
RLIMIT_NOFILE,
26
-
/// This is the maximum size of the process stack, in bytes. Upon reaching this limit, a SIGSEGV signal is generated.
33
+
/// This is the maximum size of the process stack, in bytes. Upon reaching this limit, a
34
+
/// SIGSEGV signal is generated.
27
35
RLIMIT_STACK,
28
36
29
37
// BSDs and Linux
30
-
/// This is the maximum number of bytes of memory that may be locked into RAM. This limit is in effect rounded down to the nearest multiple of the system page size.
38
+
/// This is the maximum number of bytes of memory that may be locked into RAM. This limit
39
+
/// is in effect rounded down to the nearest multiple of the system page size.
/// This specifies a ceiling to which the process's nice value can be raised using setpriority(2) or nice(2). The actual ceiling for the nice value is calculated as 20 - rlim_cur.
58
+
/// This specifies a ceiling to which the process's nice value can be raised using
59
+
/// setpriority(2) or nice(2). The actual ceiling for the nice value is calculated as 20 -
/// This is a limit (in microseconds) on the amount of CPU time that a process scheduled under a real-time scheduling policy may consume without making a blocking system call.
67
+
/// This is a limit (in microseconds) on the amount of CPU time that a process scheduled
68
+
/// under a real-time scheduling policy may consume without making a blocking system call.
/// This is a limit on the number of signals that may be queued for the real user ID of the calling process. Both standard and real-time signals are counted for the purpose of checking this limit.
71
+
/// This is a limit on the number of signals that may be queued for the real user ID of the
72
+
/// calling process. Both standard and real-time signals are counted for the purpose of
0 commit comments