From 4632adf403611b50be2b4e852a4607070935d0e5 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 4 Oct 2017 18:03:54 +0200 Subject: core: Allow disabling the use of SYS_getdents for Linux. * configure.ac (USE_LINUX_GETDENTS): New ac_define. Add option --disable-linux-getdents. * src/posix-io.c: Make use of USE_LINUX_GETDENTS. Signed-off-by: Werner Koch --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 12843170..68593574 100644 --- a/configure.ac +++ b/configure.ac @@ -762,7 +762,28 @@ fi AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no") +# Option --disable-linux-getdents +# +# By default we use SYS_getdents on Linux to optimize fd closing +# before an exec. This option allows to switch this optimization off. +use_linux_getdents=yes +AC_ARG_ENABLE(linux-getdents, + AC_HELP_STRING([--disable-linux-getdents], + [do not use SYS_getdents on Linux]), + use_linux_getdents=$enableval) +if test "$use_linux_getdents" = "yes"; then + case "${host}" in + *-*-linux*) + AC_DEFINE(USE_LINUX_GETDENTS,1, + [Defined if SYS_getdents can be used on Linux]) + ;; + esac +fi + + +# # Add a few constants to help porting to W32 +# AH_VERBATIM([SEPCONSTANTS], [ /* Separators as used in $PATH and file name. */ -- cgit v1.2.3