Zig 0.17.0-dev (Split by item)

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 library itself.

copy_cqe

Returns a copy of an I/O completion, waiting for it if necessary, and advancing the CQ ring. A convenience method for copy_cqes() for when you don't need to batch or peek.

IoUring.copy_cqe
pub fn copy_cqe(ring: *IoUring) !linux.io_uring_cqe

File

lib/std/os/linux/IoUring.zig:310

Code

pub fn copy_cqe(ring: *IoUring) !linux.io_uring_cqe {
    var cqes: [1]linux.io_uring_cqe = undefined;
    while (true) {
        const count = try ring.copy_cqes(&cqes, 1);
        if (count > 0) return cqes[0];
    }
}