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. Public Function
Returns the number of bytes that were read, which can be less than buf.len. If 0 bytes were read, that means EOF. If fd is opened in non blocking mode, the function will return error.WouldBlock when EAGAIN is received.
Linux has a limit on how many bytes may be transferred in one read call, which is 0x7ffff000 on both 64-bit and 32-bit systems. This is due to using a signed C int as the return value, as well as stuffing the errno codes into the last 4096 values. This is noted on the read man page. The limit on Darwin is 0x7fffffff, trying to read more than that returns EINVAL. The corresponding POSIX limit is maxInt(isize).
Returns the number of bytes that were read, which can be less than buf.len. If 0 bytes were read, that means EOF. If
fdis opened in non blocking mode, the function will return error.WouldBlock when EAGAIN is received.Linux has a limit on how many bytes may be transferred in one
readcall, which is0x7ffff000on both 64-bit and 32-bit systems. This is due to using a signed C int as the return value, as well as stuffing the errno codes into the last4096values. This is noted on thereadman page. The limit on Darwin is0x7fffffff, trying to read more than that returns EINVAL. The corresponding POSIX limit ismaxInt(isize).