[LTP] [PATCH 1/3] lapi/fcntl.h: Fix O_DIRECT definition for various archs

Petr Vorel pvorel@suse.cz
Wed Jun 28 10:29:50 CEST 2023


Hi all,

>  #ifndef LAPI_FCNTL_H__
> @@ -11,7 +12,15 @@
>  #include <sys/socket.h>

Maybe we should put note here:
/* Consider #define _GNU_SOURCE if you need O_DIRECT in tests */
>  #ifndef O_DIRECT
> -# define O_DIRECT 040000
> +# if defined(__mips__)
> +#  define O_DIRECT 0100000
> +# elif defined(__arm__) || defined(__aarch64__) || defined(__m68k__)
> +#  define O_DIRECT 0200000
> +# elif defined(__powerpc__) || defined(__powerpc64__)
> +#  define O_DIRECT 0400000
> +# else
> +#  define O_DIRECT 040000
> +# endif
>  #endif

Kind regards,
Petr


More information about the ltp mailing list