History

io_uring: add support for IORING_OP_ACCEPT

This allows an application to call accept4() in an async fashion. Like other opcodes, we first try a non-blocking accept, then punt to async context if we have to.

Jens Axboe committed 7 years ago

Commit 17f2fe31 parent de2ea4b2 files · +43 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+6−1
@@ -19,7 +19,10 @@ struct io_uring_sqe { · 18 unmodified lines
19 __u8 flags; /* IOSQE_ flags */19 __u8 flags; /* IOSQE_ flags */
20 __u16 ioprio; /* ioprio for the request */20 __u16 ioprio; /* ioprio for the request */
21 __s32 fd; /* file descriptor to do IO on */21 __s32 fd; /* file descriptor to do IO on */
22 __u64 off; /* offset into file */22 union {
23 __u64 off; /* offset into file */
24 __u64 addr2;
25 };
23 __u64 addr; /* pointer to buffer or iovecs */26 __u64 addr; /* pointer to buffer or iovecs */
24 __u32 len; /* buffer size or number of iovecs */27 __u32 len; /* buffer size or number of iovecs */
25 union {28 union {
@@ -29,6 +32,7 @@ struct io_uring_sqe { · 3 unmodified lines
29 __u32 sync_range_flags;32 __u32 sync_range_flags;
30 __u32 msg_flags;33 __u32 msg_flags;
31 __u32 timeout_flags;34 __u32 timeout_flags;
35 __u32 accept_flags;
32 };36 };
33 __u64 user_data; /* data to be passed back at completion time */37 __u64 user_data; /* data to be passed back at completion time */
34 union {38 union {
@@ -65,6 +69,7 @@ struct io_uring_sqe { · 30 unmodified lines
65#define IORING_OP_RECVMSG 1069#define IORING_OP_RECVMSG 10
66#define IORING_OP_TIMEOUT 1170#define IORING_OP_TIMEOUT 11
67#define IORING_OP_TIMEOUT_REMOVE 1271#define IORING_OP_TIMEOUT_REMOVE 12
72#define IORING_OP_ACCEPT 13
68 73
69/*74/*
70 * sqe->fsync_flags75 * sqe->fsync_flags