diff --git a/configure b/configure index 1f4e50b130..c4fffd998c 100755 --- a/configure +++ b/configure @@ -2295,6 +2295,23 @@ if compile_prog "" "-lcunit" "CUnit"; then fi print_config "CUnit" "$cunit" +########################################## +# check for __kernel_rwf_t +__kernel_rwf_t="no" +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + __kernel_rwf_t x; + x = 0; + return x; +} +EOF +if compile_prog "" "" "__kernel_rwf_t"; then + __kernel_rwf_t="yes" +fi +print_config "__kernel_rwf_t" "$__kernel_rwf_t" + ############################################################################# if test "$wordsize" = "64" ; then @@ -2563,6 +2580,9 @@ fi if test "$cunit" = "yes" ; then output_sym "CONFIG_HAVE_CUNIT" fi +if test "$__kernel_rwf_t" = "yes"; then + output_sym "CONFIG_HAVE_KERNEL_RWF_T" +fi echo "LIBS+=$LIBS" >> $config_host_mak echo "GFIO_LIBS+=$GFIO_LIBS" >> $config_host_mak diff --git a/engines/io_uring.c b/engines/io_uring.c index 15a4d47536..e051086b52 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -20,6 +20,7 @@ #ifdef ARCH_HAVE_IOURING +#include "../lib/types.h" #include "../os/io_uring.h" struct io_sq_ring { diff --git a/lib/types.h b/lib/types.h index 236bf8a3a8..d92b064c25 100644 --- a/lib/types.h +++ b/lib/types.h @@ -13,4 +13,8 @@ typedef int bool; #include /* IWYU pragma: export */ #endif +#if !defined(CONFIG_HAVE_KERNEL_RWF_T) +typedef int __kernel_rwf_t; +#endif + #endif diff --git a/t/io_uring.c b/t/io_uring.c index 4efc015d6f..6405536006 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -21,6 +21,7 @@ #include #include "../arch/arch.h" +#include "../lib/types.h" #include "../os/io_uring.h" #define barrier() __asm__ __volatile__("": : :"memory")