public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lapi/io_uring.h: Add declaration of __kernel_rwf_t
@ 2020-07-17  4:13 Yang Xu
  2020-07-17  7:38 ` Petr Vorel
  0 siblings, 1 reply; 8+ messages in thread
From: Yang Xu @ 2020-07-17  4:13 UTC (permalink / raw)
  To: ltp

Since kernel commit ddef7ed2b5cb ("annotate RWF_... flags"), fs.h introduced
 __kernel_rwf_t data type in 4.14-rc1.

Fix build error on old kernel.
In file included from io_uring01.c:20:
../../../../include/lapi/io_uring.h:38: error: expected specifier-qualifier-list before ?__kernel_rwf_t?
io_uring01.c:266: warning: missing initializer
io_uring01.c:266: warning: (near initialization for ?(anonymous)[1].ptr?)
io_uring01.c:268: warning: missing initializer
io_uring01.c:268: warning: (near initialization for ?test.caps?)
make: *** [io_uring01] Error 1

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
 include/lapi/io_uring.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h
index 8e47501a5..4a8978e87 100644
--- a/include/lapi/io_uring.h
+++ b/include/lapi/io_uring.h
@@ -12,6 +12,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
+#include <linux/types.h>
 #include <sys/uio.h>
 #include <stdlib.h>
 #include <linux/fs.h>
@@ -20,6 +21,10 @@
 
 #ifndef IOSQE_FIXED_FILE
 
+#ifndef __kernel_rwf_t
+typedef int __bitwise __kernel_rwf_t;
+#endif
+
 /*
  * IO submission data structure (Submission Queue Entry)
  */
-- 
2.23.0




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-19 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-17  4:13 [LTP] [PATCH] lapi/io_uring.h: Add declaration of __kernel_rwf_t Yang Xu
2020-07-17  7:38 ` Petr Vorel
2020-07-17  8:08   ` Petr Vorel
2020-07-17 10:32     ` Yang Xu
2020-07-17 10:38       ` Cyril Hrubis
2020-07-17 11:04         ` Petr Vorel
2020-07-17 11:29         ` Petr Vorel
2020-07-19 17:26           ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox