aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-12-03 16:45:55 -0800
committerGitHub <noreply@github.com>2021-12-03 16:45:55 -0800
commit36b6e95aa3638fa8449526f68e46bc86d4b22e5c (patch)
tree5c1041e8ca7a6ddca8161e27a6ba36e10ed3380c /lib/std/os/linux.zig
parentbb75f5d29709c7593dfe7269f70515919ff25c74 (diff)
parentd7c770fb7f071543c21d91dc2d01f01df81f0cf6 (diff)
downloadzig-36b6e95aa3638fa8449526f68e46bc86d4b22e5c.tar.gz
zig-36b6e95aa3638fa8449526f68e46bc86d4b22e5c.zip
Merge pull request #9927 from vrischmann/fix-rlimit-resource
Fix rlimit_resource for MIPS and SPARC
Diffstat (limited to 'lib/std/os/linux.zig')
-rw-r--r--lib/std/os/linux.zig89
1 files changed, 46 insertions, 43 deletions
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig
index d4c9d09120..c62160a4ba 100644
--- a/lib/std/os/linux.zig
+++ b/lib/std/os/linux.zig
@@ -4197,65 +4197,68 @@ pub const ifreq = extern struct {
};
// doc comments copied from musl
-pub const rlimit_resource = enum(c_int) {
- /// Per-process CPU limit, in seconds.
- CPU,
+pub const rlimit_resource = if (native_arch.isMIPS() or native_arch.isSPARC())
+ arch_bits.rlimit_resource
+else
+ enum(c_int) {
+ /// Per-process CPU limit, in seconds.
+ CPU,
- /// Largest file that can be created, in bytes.
- FSIZE,
+ /// Largest file that can be created, in bytes.
+ FSIZE,
- /// Maximum size of data segment, in bytes.
- DATA,
+ /// Maximum size of data segment, in bytes.
+ DATA,
- /// Maximum size of stack segment, in bytes.
- STACK,
+ /// Maximum size of stack segment, in bytes.
+ STACK,
- /// Largest core file that can be created, in bytes.
- CORE,
+ /// Largest core file that can be created, in bytes.
+ CORE,
- /// Largest resident set size, in bytes.
- /// This affects swapping; processes that are exceeding their
- /// resident set size will be more likely to have physical memory
- /// taken from them.
- RSS,
+ /// Largest resident set size, in bytes.
+ /// This affects swapping; processes that are exceeding their
+ /// resident set size will be more likely to have physical memory
+ /// taken from them.
+ RSS,
- /// Number of processes.
- NPROC,
+ /// Number of processes.
+ NPROC,
- /// Number of open files.
- NOFILE,
+ /// Number of open files.
+ NOFILE,
- /// Locked-in-memory address space.
- MEMLOCK,
+ /// Locked-in-memory address space.
+ MEMLOCK,
- /// Address space limit.
- AS,
+ /// Address space limit.
+ AS,
- /// Maximum number of file locks.
- LOCKS,
+ /// Maximum number of file locks.
+ LOCKS,
- /// Maximum number of pending signals.
- SIGPENDING,
+ /// Maximum number of pending signals.
+ SIGPENDING,
- /// Maximum bytes in POSIX message queues.
- MSGQUEUE,
+ /// Maximum bytes in POSIX message queues.
+ MSGQUEUE,
- /// Maximum nice priority allowed to raise to.
- /// Nice levels 19 .. -20 correspond to 0 .. 39
- /// values of this resource limit.
- NICE,
+ /// Maximum nice priority allowed to raise to.
+ /// Nice levels 19 .. -20 correspond to 0 .. 39
+ /// values of this resource limit.
+ NICE,
- /// Maximum realtime priority allowed for non-priviledged
- /// processes.
- RTPRIO,
+ /// Maximum realtime priority allowed for non-priviledged
+ /// processes.
+ RTPRIO,
- /// Maximum CPU time in µs that a process scheduled under a real-time
- /// scheduling policy may consume without making a blocking system
- /// call before being forcibly descheduled.
- RTTIME,
+ /// Maximum CPU time in µs that a process scheduled under a real-time
+ /// scheduling policy may consume without making a blocking system
+ /// call before being forcibly descheduled.
+ RTTIME,
- _,
-};
+ _,
+ };
pub const rlim_t = u64;