commit 8ce33795e95ea0390d320ea2acc60059b460941e (tree)
parent bb9a9d8f2673fb091983c618ba3eea4a8bb908f8
Author: Ratakor <ratakor@disroot.org>
Date: Fri, 1 Sep 2023 13:38:14 +0200
Add pause() to linux.zig
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig
@@ -1042,6 +1042,14 @@ pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize {
return syscall2(.nanosleep, @intFromPtr(req), @intFromPtr(rem));
}
+pub fn pause() usize {
+ if (@hasField(SYS, "pause")) {
+ return syscall0(.pause);
+ } else {
+ return syscall4(.ppoll, 0, 0, 0, 0);
+ }
+}
+
pub fn setuid(uid: uid_t) usize {
if (@hasField(SYS, "setuid32")) {
return syscall1(.setuid32, uid);