| ... | ... | @@ -3818,12 +3818,14 @@ pub fn sendfile( |
| 3818 | 3818 | switch (err) { |
| 3819 | 3819 | 0 => return amt, |
| 3820 | 3820 | |
| 3821 | | EBADF => unreachable, // Always a race condition. |
| 3822 | 3821 | EFAULT => unreachable, // Segmentation fault. |
| 3823 | 3822 | EINVAL => unreachable, |
| 3824 | 3823 | ENOTCONN => unreachable, // `out_fd` is an unconnected socket. |
| 3825 | 3824 | |
| 3826 | | ENOTSUP, ENOTSOCK, ENOSYS => break :sf, |
| 3825 | // On macOS version 10.14.6, I observed Darwin return EBADF when |
| 3826 | // using sendfile on a valid open file descriptor of a file |
| 3827 | // system file. |
| 3828 | ENOTSUP, ENOTSOCK, ENOSYS, EBADF => break :sf, |
| 3827 | 3829 | |
| 3828 | 3830 | EINTR => if (amt != 0) return amt else continue, |
| 3829 | 3831 | |