mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
`send_zc` tries to avoid making intermediate copies of data. Zerocopy execution is not guaranteed and may fall back to copying. The flags field of the first struct io_uring_cqe may likely contain IORING_CQE_F_MORE , which means that there will be a second completion event / notification for the request, with the user_data field set to the same value. The user must not modify the data buffer until the notification is posted. The first cqe follows the usual rules and so its res field will contain the number of bytes sent or a negative error code. The notification's res field will be set to zero and the flags field will contain IORING_CQE_F_NOTIF. The two step model is needed because the kernel may hold on to buffers for a long time, e.g. waiting for a TCP ACK, and having a separate cqe for request completions allows userspace to push more data without extra delays. Note, notifications are only responsible for controlling the lifetime of the buffers, and as such don't mean anything about whether the data has atually been sent out or received by the other end. Even errored requests may generate a notification, and the user must check for IORING_CQE_F_MORE rather than relying on the result. Available since kernel 6.0. References: https://man7.org/linux/man-pages/man3/io_uring_prep_send_zc.3.html https://man7.org/linux/man-pages/man2/io_uring_enter.2.html |
||
|---|---|---|
| .. | ||
| bpf | ||
| errno | ||
| arm-eabi.zig | ||
| arm64.zig | ||
| bpf.zig | ||
| io_uring.zig | ||
| ioctl.zig | ||
| mips.zig | ||
| mips64.zig | ||
| powerpc.zig | ||
| powerpc64.zig | ||
| riscv64.zig | ||
| seccomp.zig | ||
| sparc64.zig | ||
| start_pie.zig | ||
| syscalls.zig | ||
| test.zig | ||
| thumb.zig | ||
| tls.zig | ||
| vdso.zig | ||
| x86.zig | ||
| x86_64.zig | ||