Function send_zc [src]
Queues (but does not submit) an SQE to perform an async zerocopy send(2).
This operation will most likely produce two CQEs. The flags field of the
first cqe may likely contain IORING_CQE_F_MORE, which means that there will
be a second cqe 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. Notifications responsible for controlling
the lifetime of the buffers. Even errored requests may generate a
notification.
Available since 6.0
Prototype
pub fn send_zc( self: *IoUring, user_data: u64, fd: posix.fd_t, buffer: []const u8, send_flags: u32, zc_flags: u16, ) !*linux.io_uring_sqe
Parameters
self: *IoUring
user_data: u64
fd: posix.fd_t
buffer: []const u8
send_flags: u32
zc_flags: u16
Source
pub fn send_zc(
self: *IoUring,
user_data: u64,
fd: posix.fd_t,
buffer: []const u8,
send_flags: u32,
zc_flags: u16,
) !*linux.io_uring_sqe {
const sqe = try self.get_sqe();
sqe.prep_send_zc(fd, buffer, send_flags, zc_flags);
sqe.user_data = user_data;
return sqe;
}