3 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_CLOSEDIR],
10 AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
11 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13 AC_CHECK_FUNCS([closedir])
14 if test $ac_cv_func_closedir = no; then
17 dnl Replace closedir() on native Windows and OS/2 kLIBC,
18 dnl to support fdopendir().
19 AC_REQUIRE([gl_DIRENT_DIR])
20 if test $DIR_HAS_FD_MEMBER = 0; then
23 dnl Replace closedir() for supporting the gnulib-defined fchdir() function,
24 dnl to keep fchdir's bookkeeping up-to-date.
25 m4_ifdef([gl_FUNC_FCHDIR], [
27 if test $HAVE_FCHDIR = 0; then