[LTP] [PATCH v2 1/1] lapi/io_uring: <sys/types.h> => <linux/types.h>

Cyril Hrubis chrubis@suse.cz
Fri Jan 26 16:29:54 CET 2024


Hi!
> 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>.

I did look twice and we do not seem to use anything from the
<sys/types.h> in the header, so this should be safe.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list