[LTP] [PATCH v1] io_uring02.c: Check EOPNOTSUPP errno

Wei Gao wegao@suse.com
Fri Jan 20 07:12:47 CET 2023


Add check for errno == EOPNOTSUPP and quit with TCONF instead of TBROK

Signed-off-by: Wei Gao <wegao@suse.com>
---
 lib/tst_safe_io_uring.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/tst_safe_io_uring.c b/lib/tst_safe_io_uring.c
index f300fd38c..923c3e43d 100644
--- a/lib/tst_safe_io_uring.c
+++ b/lib/tst_safe_io_uring.c
@@ -15,6 +15,10 @@ int safe_io_uring_init(const char *file, const int lineno,
 	uring->fd = io_uring_setup(entries, params);
 
 	if (uring->fd == -1) {
+		if (errno == EOPNOTSUPP) {
+			tst_brk(TCONF,
+				"io_uring_setup() is not supported");
+		}
 		tst_brk_(file, lineno, TBROK | TERRNO,
 			"io_uring_setup() failed");
 		return uring->fd;
-- 
2.35.3



More information about the ltp mailing list