Skip to content

Commit 746b6db

Browse files
committed
lapi/io_uring: <sys/types.h> => <linux/types.h>
This fixes compilation on old toolchains: Some old toolchains require to add <linux/types.h> to missing kernel types: tst_safe_io_uring.c: In function ‘safe_io_uring_init’: tst_safe_io_uring.c:34:45: error: ‘__u32’ undeclared (first use in this function) 34 | params->sq_entries * sizeof(__u32); | ^~~~~ io_uring02.c: In function ‘drain_fallback’: io_uring02.c:106:34: error: ‘__u64’ undeclared (first use in this function) 106 | sqe_ptr->addr = (__u64)&spam_header; | ^~~~~ io_uring02.c:106:34: note: each undeclared identifier is reported only once for each function it appears in io_uring02.c: In function ‘run’: io_uring02.c:221:26: error: ‘__u64’ undeclared (first use in this function) 221 | sqe_ptr->addr = (__u64)&beef_header; | ^~~~~ Newer kernel headers includes <linux/types.h> in <linux/io_uring.h>, but we still support compilers without this header. Therefore replace <sys/types.h> in lapi header with <linux/types.h>. Link: https://lore.kernel.org/ltp/[email protected]/ Fixes: 3f2ff54 ("Add safe functions for io_uring to LTP library") Fixes: c4f669f ("Add test for CVE 2020-29373") Reviewed-by: Cyril Hrubis <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent bae8ec9 commit 746b6db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/lapi/io_uring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
#include <unistd.h>
1313
#include <fcntl.h>
14-
#include <sys/types.h>
1514
#include <sys/uio.h>
1615
#include <stdlib.h>
16+
#include <linux/types.h>
1717

1818
#include "lapi/syscalls.h"
1919

0 commit comments

Comments
 (0)