From 15eca9aa125bf53932dc9872b0f733e97a500c3e Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 3 Jan 2020 12:41:33 -0800 Subject: [PATCH] Only build t/read-to-pipe-async if pread() is available Reported-by: Vincent Fu Fixes: 5ad80fa7cf5b ("Makefile: Build more test code") Signed-off-by: Bart Van Assche --- Makefile | 2 ++ configure | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Makefile b/Makefile index dc2a0515..dd26afca 100644 --- a/Makefile +++ b/Makefile @@ -314,7 +314,9 @@ T_PROGS += $(T_BTRACE_FIO_PROGS) T_PROGS += $(T_DEDUPE_PROGS) T_PROGS += $(T_VS_PROGS) T_TEST_PROGS += $(T_MEMLOCK_PROGS) +ifdef CONFIG_PREAD T_TEST_PROGS += $(T_PIPE_ASYNC_PROGS) +endif ifneq (,$(findstring Linux,$(CONFIG_TARGET_OS))) T_TEST_PROGS += $(T_IOU_RING_PROGS) endif diff --git a/configure b/configure index 9020b158..f7f082da 100755 --- a/configure +++ b/configure @@ -1110,6 +1110,23 @@ if compile_prog "" "" "fdatasync"; then fi print_config "fdatasync" "$fdatasync" +########################################## +# pread() probe +if test "$pread" != "yes" ; then + pread="no" +fi +cat > $TMPC << EOF +#include +int main(int argc, char **argv) +{ + return pread(0, NULL, 0, 0); +} +EOF +if compile_prog "" "" "pread"; then + pread="yes" +fi +print_config "pread()" "$pread" + ########################################## # sync_file_range() probe if test "$sync_file_range" != "yes" ; then @@ -2493,6 +2510,9 @@ fi if test "$fdatasync" = "yes" ; then output_sym "CONFIG_FDATASYNC" fi +if test "$pread" = "yes" ; then + output_sym "CONFIG_PREAD" +fi if test "$sync_file_range" = "yes" ; then output_sym "CONFIG_SYNC_FILE_RANGE" fi -- 2.25.1