- AC_CACHE_CHECK([for working fcntl.h], gl_cv_header_working_fcntl_h,
- [AC_RUN_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <fcntl.h>
- #ifndef O_NOFOLLOW
- #define O_NOFOLLOW 0
- #endif
- static int const constants[] =
- {
- O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
- O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
- };
- ]],
- [[static char const sym[] = "conftest.sym";
- if (O_NOFOLLOW)
- {
- if (symlink (".", sym) != 0)
- return 1;
- if (open (sym, O_RDONLY | O_NOFOLLOW) == 0)
- return 1;
- }
- return !constants;]])],
- [gl_cv_header_working_fcntl_h=yes],
- [gl_cv_header_working_fcntl_h=no],
- [gl_cv_header_working_fcntl_h=cross-compiling])])
+ AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+ AC_REQUIRE([gl_FCNTL_O_FLAGS])
+ gl_NEXT_HEADERS([fcntl.h])