Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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

send_zc

Public Function
std.os.linux.IoUring.send_zc
pub fn send_zc(
    self: *IoUring,
    user_data: u64,
    fd: linux.fd_t,
    buffer: []const u8,
    send_flags: u32,
    zc_flags: u16,
) !*linux.io_uring_sqe

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

Params

  • self: *IoUring
  • user_data: u64
  • fd: linux.fd_t
  • buffer: []const u8
  • send_flags: u32
  • zc_flags: u16

File

os/linux/IoUring.zig:685
685
686
687
688
689
690
691
692
693
694
695
696
697
pub fn send_zc(
    self: *IoUring,
    user_data: u64,
    fd: linux.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;
}