Function register_files_update [src]

Updates registered file descriptors. Updates are applied starting at the provided offset in the original file descriptors slice. There are three kind of updates: turning a sparse entry (where the fd is -1) into a real one removing an existing entry (set the fd to -1) replacing an existing entry with a new fd Adding new file descriptors must be done with register_files.

Prototype

pub fn register_files_update(self: *IoUring, offset: u32, fds: []const posix.fd_t) !void

Parameters

self: *IoUringoffset: u32fds: []const posix.fd_t

Source

pub fn register_files_update(self: *IoUring, offset: u32, fds: []const posix.fd_t) !void { assert(self.fd >= 0); const FilesUpdate = extern struct { offset: u32, resv: u32, fds: u64 align(8), }; var update = FilesUpdate{ .offset = offset, .resv = @as(u32, 0), .fds = @as(u64, @intFromPtr(fds.ptr)), }; const res = linux.io_uring_register( self.fd, .REGISTER_FILES_UPDATE, @as(*const anyopaque, @ptrCast(&update)), @as(u32, @intCast(fds.len)), ); try handle_registration_result(res); }