public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Martin Doucha <mdoucha@suse.cz>
To: Sachin Sant <sachinp@linux.ibm.com>, ltp@lists.linux.it
Subject: [LTP] [PATCH] lapi/io_uring: Add IORING_OP_READ/WRITE constants
Date: Mon, 20 Apr 2026 18:34:09 +0200	[thread overview]
Message-ID: <20260420163433.44646-1-mdoucha@suse.cz> (raw)

Add fallback definitions for IORING_OP_READ and IORING_OP_WRITE.
These constants have been added in kernel v5.6 and older systems may
lack them, which results in LTP build failures.

Fixes: fcc4887e73 ("io_uring: Test IORING READ and WRITE operations")
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---
 configure.ac            |  2 ++
 include/lapi/io_uring.h | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 812f17d8b..4b789bfe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,8 @@ AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include <sys/mman.h>])
 AC_CHECK_DECLS([NFTA_CHAIN_ID, NFTA_VERDICT_CHAIN_ID],,,[#include <linux/netfilter/nf_tables.h>])
 AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include <sys/prctl.h>])
 AC_CHECK_DECLS([SEM_STAT_ANY],,,[#include <sys/sem.h>])
+AC_CHECK_DECLS([IORING_OP_READ],,,[#include <linux/io_uring.h>])
+AC_CHECK_DECLS([IORING_OP_WRITE],,,[#include <linux/io_uring.h>])
 
 AC_CHECK_HEADERS_ONCE([ \
     aio.h \
diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h
index c05517595..46168363d 100644
--- a/include/lapi/io_uring.h
+++ b/include/lapi/io_uring.h
@@ -253,6 +253,16 @@ struct io_uring_probe {
 	struct io_uring_probe_op ops[0];
 };
 
+#else /* IOSQE_FIXED_FILE */
+
+#ifndef HAVE_IORING_OP_READ
+#define IORING_OP_READ 22
+#endif
+
+#ifndef HAVE_IORING_OP_WRITE
+#define IORING_OP_WRITE 23
+#endif
+
 #endif /* IOSQE_FIXED_FILE */
 
 #ifndef IOSQE_IO_HADRLINK
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-04-20 16:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 16:34 Martin Doucha [this message]
2026-04-20 18:02 ` [LTP] lapi/io_uring: Add IORING_OP_READ/WRITE constants linuxtestproject.agent

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=20260420163433.44646-1-mdoucha@suse.cz \
    --to=mdoucha@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=sachinp@linux.ibm.com \
    /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