From: Sachin Sant <sachinp@linux.ibm.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lapi/io_uring: Add fallback definitions for OP_READ(WRITE)
Date: Thu, 16 Apr 2026 18:11:44 +0530 [thread overview]
Message-ID: <20260416124144.19343-1-sachinp@linux.ibm.com> (raw)
Add fallback definitions for IORING_OP_READ and IORING_OP_WRITE
opcodes to support building on older distributions with kernel
headers between v5.1 and v5.5.
These opcodes were introduced in kernel v5.6, but some distros
may have io_uring support from v5.1+ without these newer
operation codes.
Fixes: fcc4887e73ca (io_uring: Test IORING READ and WRITE operations)
Reported-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
include/lapi/io_uring.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h
index c05517595..d95a4cd59 100644
--- a/include/lapi/io_uring.h
+++ b/include/lapi/io_uring.h
@@ -267,6 +267,16 @@ struct io_uring_probe {
#define IOSQE_ASYNC (1U << IOSQE_ASYNC_BIT)
#endif /* IOSQE_ASYNC */
+#ifndef IORING_OP_READ
+/* Added in kernel v5.6 */
+#define IORING_OP_READ 22
+#endif /* IORING_OP_READ */
+
+#ifndef IORING_OP_WRITE
+/* Added in kernel v5.6 */
+#define IORING_OP_WRITE 23
+#endif /* IORING_OP_WRITE */
+
#ifndef HAVE_IO_URING_REGISTER
static inline int io_uring_register(int fd, unsigned int opcode, void *arg,
unsigned int nr_args)
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2026-04-16 12:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 12:41 Sachin Sant [this message]
2026-04-16 13:35 ` [LTP] lapi/io_uring: Add fallback definitions for OP_READ(WRITE) linuxtestproject.agent
2026-04-16 16:18 ` [LTP] [PATCH] " Martin Doucha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260416124144.19343-1-sachinp@linux.ibm.com \
--to=sachinp@linux.ibm.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox