diff mbox series

[1/5] io_uring: uapi: Sync the {g,s}etsockopt fields

Message ID 20231020133917.953642-2-leitao@debian.org (mailing list archive)
State New
Headers show
Series liburing: Add {g,s}etsockopt command support | expand

Commit Message

Breno Leitao Oct. 20, 2023, 1:39 p.m. UTC
Copy the UAPI fields necessary to support the new
SOCKET_URING_OP_GETSOCKOPT and SOCKET_URING_OP_SETSOCKOPT socket
commands.

Sync the necessary bits for io_uring_sqe struct from the kernel, and
also adds the SOCKET_URING_OP_GETSOCKOPT and SOCKET_URING_OP_SETSOCKOPT
to the enum that defines the commands.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 src/include/liburing/io_uring.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 10a6ef0..a7a95a3 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -43,6 +43,10 @@  struct io_uring_sqe {
 	union {
 		__u64	addr;	/* pointer to buffer or iovecs */
 		__u64	splice_off_in;
+		struct {
+			__u32	level;
+			__u32	optname;
+		};
 	};
 	__u32	len;		/* buffer size or number of iovecs */
 	union {
@@ -79,6 +83,7 @@  struct io_uring_sqe {
 	union {
 		__s32	splice_fd_in;
 		__u32	file_index;
+		__u32	optlen;
 		struct {
 			__u16	addr_len;
 			__u16	__pad3[1];
@@ -89,6 +94,7 @@  struct io_uring_sqe {
 			__u64	addr3;
 			__u64	__pad2[1];
 		};
+		__u64	optval;
 		/*
 		 * If the ring is initialized with IORING_SETUP_SQE128, then
 		 * this field is used for 80 bytes of arbitrary command data
@@ -721,6 +727,8 @@  struct io_uring_recvmsg_out {
 enum {
 	SOCKET_URING_OP_SIOCINQ		= 0,
 	SOCKET_URING_OP_SIOCOUTQ,
+	SOCKET_URING_OP_GETSOCKOPT,
+	SOCKET_URING_OP_SETSOCKOPT,
 };
 
 #ifdef __cplusplus