3 dnl Copyright (C) 2009-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 # See if we need to provide faccessat replacement.
10 # Written by Eric Blake.
12 AC_DEFUN([gl_FUNC_FACCESSAT],
14 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
17 dnl Persuade glibc <unistd.h> to declare faccessat().
18 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
20 gl_CHECK_FUNCS_ANDROID([faccessat], [[#include <unistd.h>]])
21 if test $ac_cv_func_faccessat = no; then
23 case "$gl_cv_onwards_func_faccessat" in
24 future*) REPLACE_FACCESSAT=1 ;;
27 case $gl_cv_func_lstat_dereferences_slashed_symlink in
29 *) REPLACE_FACCESSAT=1 ;;
34 # Prerequisites of lib/faccessat.c.
35 AC_DEFUN([gl_PREREQ_FACCESSAT],
37 AC_CHECK_FUNCS([access])