Function register_files_sparse [src]
Registers an empty (-1) file table of nr_files number of file descriptors.
Prototype
pub fn register_files_sparse(self: *IoUring, nr_files: u32) !void Parameters
self: *IoUringnr_files: u32 Source
pub fn register_files_sparse(self: *IoUring, nr_files: u32) !void {
assert(self.fd >= 0);
const reg = &linux.io_uring_rsrc_register{
.nr = nr_files,
.flags = linux.IORING_RSRC_REGISTER_SPARSE,
.resv2 = 0,
.data = 0,
.tags = 0,
};
const res = linux.io_uring_register(
self.fd,
.REGISTER_FILES2,
@ptrCast(reg),
@as(u32, @sizeOf(linux.io_uring_rsrc_register)),
);
return handle_registration_result(res);
}