dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
[gl_cv_func_fcntl_f_dupfd_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly],
[gl_cv_func_fcntl_f_dupfd_works],
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
if (errno != EINVAL) result |= 2;
if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
if (errno != EINVAL) result |= 2;