2 dnl Copyright (C) 2011 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_DUP],
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST])
11 AC_CHECK_HEADERS_ONCE([unistd.h])
12 AC_CACHE_CHECK([whether dup supports bad arguments], [gl_cv_func_dup_works],
28 [gl_cv_func_dup_works=yes],
29 [gl_cv_func_dup_works=no],
31 mingw*) gl_cv_func_dup_works="guessing no" ;;
32 *) gl_cv_func_dup_works="guessing yes" ;;
36 case "$gl_cv_func_dup_works" in
39 dnl Replace dup() for supporting the gnulib-defined fchdir() function,
40 dnl to keep fchdir's bookkeeping up-to-date.
41 m4_ifdef([gl_FUNC_FCHDIR], [
43 if test $HAVE_FCHDIR = 0; then
49 # Prerequisites of lib/dup.c.
50 AC_DEFUN([gl_PREREQ_DUP], [
51 AC_REQUIRE([AC_C_INLINE])