diff options
author | Petr Vorel <pvorel@suse.cz> | 2024-01-26 12:15:06 +0100 |
---|---|---|
committer | Petr Vorel <petr.vorel@gmail.com> | 2024-01-27 06:52:31 +0100 |
commit | 746b6db3621217bdb6198926a5f1c58a6b25a365 (patch) | |
tree | ab79410b2fadc788249ceab2ccb4a206c535d795 | |
parent | bae8ec9a3937154defdf96a5d6f1b165aebebbe5 (diff) | |
download | ltp-746b6db3621217bdb6198926a5f1c58a6b25a365.tar.gz |
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/20240126111506.491324-1-pvorel@suse.cz/
Fixes: 3f2ff5431 ("Add safe functions for io_uring to LTP library")
Fixes: c4f669f13 ("Add test for CVE 2020-29373")
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
-rw-r--r-- | include/lapi/io_uring.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h index 03c45190e..c05517595 100644 --- a/include/lapi/io_uring.h +++ b/include/lapi/io_uring.h @@ -11,9 +11,9 @@ #include <unistd.h> #include <fcntl.h> -#include <sys/types.h> #include <sys/uio.h> #include <stdlib.h> +#include <linux/types.h> #include "lapi/syscalls.h" |