2 dnl Copyright (C) 2006 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 dnl Written by Paul Eggert.
11 AC_CACHE_CHECK([for working fcntl.h], gl_cv_header_working_fcntl_h,
14 [[#include <sys/types.h>
21 static int const constants[] =
23 O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
24 O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
27 [[static char const sym[] = "conftest.sym";
30 if (symlink (".", sym) != 0)
32 if (open (sym, O_RDONLY | O_NOFOLLOW) == 0)
35 return !constants;]])],
36 [gl_cv_header_working_fcntl_h=yes],
37 [gl_cv_header_working_fcntl_h=no],
38 [gl_cv_header_working_fcntl_h=cross-compiling])])
40 if test $gl_cv_header_working_fcntl_h != yes; then
41 AC_DEFINE([O_NOFOLLOW_IS_INEFFECTIVE], 1,
42 [Define to 1 if O_NOFOLLOW is ineffective.])
45 gl_ABSOLUTE_HEADER([fcntl.h])
46 ABSOLUTE_FCNTL_H=\"$gl_cv_absolute_fcntl_h\"
47 AC_SUBST([ABSOLUTE_FCNTL_H])