fn writeIntFd(fd: posix.fd_t, value: ErrInt) !void
fn writeIntFd(fd: posix.fd_t, value: ErrInt) !void { var buffer: [8]u8 = undefined; std.mem.writeInt(u64, &buffer, value, .little); // Skip the cancel mechanism. var i: usize = 0; while (true) { const rc = posix.system.write(fd, buffer[i..].ptr, buffer.len - i); switch (posix.errno(rc)) { .SUCCESS => { const n: usize = @intCast(rc); i += n; if (buffer.len - i == 0) return; }, .INTR => continue, else => return error.SystemResources, } } }