From: Yang Xiuwei <yangxiuwei@kylinos.cn>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, Yang Xiuwei <yangxiuwei@kylinos.cn>
Subject: [PATCH v2 2/2] test/cbpf_filter: fix build when openat2.h is not available
Date: Mon, 16 Mar 2026 09:36:21 +0800 [thread overview]
Message-ID: <20260316013621.115939-3-yangxiuwei@kylinos.cn> (raw)
In-Reply-To: <20260316013621.115939-1-yangxiuwei@kylinos.cn>
cbpf_filter.c included <linux/openat2.h> for struct open_how and
RESOLVE_IN_ROOT, so the test failed to build on systems without that
header (e.g. older distros). liburing's compat already provides
struct open_how; add a fallback #define for RESOLVE_IN_ROOT (0x10)
when the header is missing, so the test both builds and runs on
old headers with a current kernel.
Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
---
test/cbpf_filter.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/test/cbpf_filter.c b/test/cbpf_filter.c
index 41fd284e..b80b1503 100644
--- a/test/cbpf_filter.c
+++ b/test/cbpf_filter.c
@@ -15,12 +15,15 @@
#include <sys/wait.h>
#include <sys/prctl.h>
#include <linux/filter.h>
-#include <linux/openat2.h>
#include "liburing.h"
#include "liburing/io_uring/bpf_filter.h"
#include "helpers.h"
+#ifndef RESOLVE_IN_ROOT
+#define RESOLVE_IN_ROOT 0x10
+#endif
+
/*
* cBPF filter context layout (struct io_uring_bpf_ctx):
* offset 0: user_data (u64)
--
2.25.1
next prev parent reply other threads:[~2026-03-16 1:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 1:36 [PATCH v2 0/2] build and compiler warning fixes Yang Xiuwei
2026-03-16 1:36 ` [PATCH v2 1/2] examples/send-zerocopy: fix -Wstringop-truncation on ifr.ifr_name Yang Xiuwei
2026-03-16 1:36 ` Yang Xiuwei [this message]
2026-03-16 10:37 ` [PATCH v2 0/2] build and compiler warning fixes Jens Axboe
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=20260316013621.115939-3-yangxiuwei@kylinos.cn \
--to=yangxiuwei@kylinos.cn \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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