mirror of
https://github.com/ziglang/zig.git
synced 2025-02-02 20:21:35 +00:00
Darwin can return EBADF for sendfile on non-files
This commit is contained in:
parent
c4f81586f1
commit
1141bfb21b
@ -3818,12 +3818,14 @@ pub fn sendfile(
|
|||||||
switch (err) {
|
switch (err) {
|
||||||
0 => return amt,
|
0 => return amt,
|
||||||
|
|
||||||
EBADF => unreachable, // Always a race condition.
|
|
||||||
EFAULT => unreachable, // Segmentation fault.
|
EFAULT => unreachable, // Segmentation fault.
|
||||||
EINVAL => unreachable,
|
EINVAL => unreachable,
|
||||||
ENOTCONN => unreachable, // `out_fd` is an unconnected socket.
|
ENOTCONN => unreachable, // `out_fd` is an unconnected socket.
|
||||||
|
|
||||||
ENOTSUP, ENOTSOCK, ENOSYS => break :sf,
|
// On macOS version 10.14.6, I observed Darwin return EBADF when
|
||||||
|
// using sendfile on a valid open file descriptor of a file
|
||||||
|
// system file.
|
||||||
|
ENOTSUP, ENOTSOCK, ENOSYS, EBADF => break :sf,
|
||||||
|
|
||||||
EINTR => if (amt != 0) return amt else continue,
|
EINTR => if (amt != 0) return amt else continue,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user