commit ecfd9cef7d892cddf2a65a64a2906a881bab12fb (tree)
parent 8d914ea7340c920c1929c5d666fc802b15f49a64
Author: nikneym <halildrk@gmail.com>
Date: Tue, 11 Feb 2025 13:17:54 +0300
linux/io_uring_sqe: add prep_cancel_fd
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/std/os/linux/io_uring_sqe.zig b/lib/std/os/linux/io_uring_sqe.zig
@@ -436,6 +436,15 @@ pub const io_uring_sqe = extern struct {
sqe.rw_flags = flags;
}
+ pub fn prep_cancel_fd(
+ sqe: *linux.io_uring_sqe,
+ fd: linux.fd_t,
+ flags: u32,
+ ) void {
+ sqe.prep_rw(.ASYNC_CANCEL, fd, 0, 0, 0);
+ sqe.rw_flags = flags | linux.IORING_ASYNC_CANCEL_FD;
+ }
+
pub fn prep_shutdown(
sqe: *linux.io_uring_sqe,
sockfd: linux.socket_t,