Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Threaded › fileSyncPosix Private Function fileSyncPosix Doc Source Private Function std.Io.Threaded.fileSyncPosix
fn fileSyncPosix (userdata : ?*anyopaque , file : File ) File .SyncError !void Params userdata : ?*anyopaque file : File File Io/Threaded.zig: 8769
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794 fn fileSyncPosix (userdata : ?*anyopaque , file : File ) File .SyncError !void {
const t : *Threaded = @ptrCast (@alignCast (userdata ));
_ = t ;
const syscall : Syscall = try .start ();
while (true ) {
switch (posix .errno (posix .system .fsync (file .handle ))) {
.SUCCESS => return syscall .finish (),
.INTR => {
try syscall .checkCancel ();
continue ;
},
else => |e | {
syscall .finish ();
switch (e ) {
.BADF => |err | return errnoBug (err ),
.INVAL => |err | return errnoBug (err ),
.ROFS => |err | return errnoBug (err ),
.IO => return error .InputOutput ,
.NOSPC => return error .NoSpaceLeft ,
.DQUOT => return error .DiskQuota ,
else => |err | return posix .unexpectedErrno (err ),
}
},
}
}
}