authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:31 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-20 16:45:31 -07:00
logf7f103e22f9c75ec0711c48a7b431eedff541be0
tree67e424623cafafe15ff201e7a844d231b8c136a1
parent93ee0b6a894e9cede29b87c42ab677052200e3d3

add sync


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

mod.zig+7-1
......@@ -917,7 +917,13 @@ pub const chroot = @compileError("TODO: chroot");
917917// sync
918918// void sync(void);
919919// asmlinkage long sys_sync(void);
920pub const sync = @compileError("TODO: sync");
920pub fn sync() errno.Error!void {
921 const r = syscall0(.sync);
922 return switch (_errno(r)) {
923 .ok => {},
924 _ => |c| errno.errorFromInt(@intFromEnum(c)),
925 };
926}
921927
922928// acct
923929// int acct(const char *_Nullable filename);
test.zig+1
......@@ -21,4 +21,5 @@ test {
2121 _ = &linux.setsid;
2222 _ = &linux.munlockall;
2323 _ = &linux.vhangup;
24 _ = &linux.sync;
2425}