diff options
| author | Özgür Akkurt <oezgurmakkurt@gmail.com> | 2025-08-16 13:18:49 +0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-16 09:18:49 +0200 |
| commit | 99c489055951c09c1a22973078e5d7dbda14bac1 (patch) | |
| tree | ab4ba4e2d7da8247ba4236ecd2d17c21443af56f /lib/std/os/linux | |
| parent | 98547713a354efef406ca79731db8984eb26c051 (diff) | |
| download | zig-99c489055951c09c1a22973078e5d7dbda14bac1.tar.gz zig-99c489055951c09c1a22973078e5d7dbda14bac1.zip | |
implement registering NAPI on IoUring (#24850)
Diffstat (limited to 'lib/std/os/linux')
| -rw-r--r-- | lib/std/os/linux/IoUring.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/std/os/linux/IoUring.zig b/lib/std/os/linux/IoUring.zig index 62a87ac103..25d4d88fd0 100644 --- a/lib/std/os/linux/IoUring.zig +++ b/lib/std/os/linux/IoUring.zig @@ -1270,6 +1270,18 @@ pub fn unregister_eventfd(self: *IoUring) !void { try handle_registration_result(res); } +pub fn register_napi(self: *IoUring, napi: *linux.io_uring_napi) !void { + assert(self.fd >= 0); + const res = linux.io_uring_register(self.fd, .REGISTER_NAPI, napi, 1); + try handle_registration_result(res); +} + +pub fn unregister_napi(self: *IoUring, napi: *linux.io_uring_napi) !void { + assert(self.fd >= 0); + const res = linux.io_uring_register(self.fd, .UNREGISTER_NAPI, napi, 1); + try handle_registration_result(res); +} + /// Registers an array of buffers for use with `read_fixed` and `write_fixed`. pub fn register_buffers(self: *IoUring, buffers: []const posix.iovec) !void { assert(self.fd >= 0); |
