authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:42:24 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:42:24 -07:00
log425d3fafed49cdf21fe2a18b2e29bea523017ccc
tree6b94248f6d3540301562ffc232fb3d414added93
parentf53f2ca287b1f091d8a58786f2d5529289d4afff

add pause


2 files changed, 8 insertions(+), 1 deletions(-)

mod.zig+7-1
......@@ -206,7 +206,13 @@ pub const dup2 = @compileError("TODO: dup2");
206206// pause
207207// int pause(void);
208208// asmlinkage long sys_pause(void);
209pub const pause = @compileError("TODO: pause");
209pub fn pause() errno.Error!c_int {
210 const r = syscall0(.pause);
211 return switch (_errno(r)) {
212 .ok => @intCast(r),
213 _ => |c| errno.errorFromInt(@intFromEnum(c)),
214 };
215}
210216
211217// nanosleep
212218// int nanosleep(const struct timespec *duration, struct timespec *_Nullable rem);
test.zig+1
......@@ -8,4 +8,5 @@ test {
88 _ = &linux.read;
99 _ = &linux.write;
1010 _ = &linux.sched_yield;
11 _ = &linux.pause;
1112}