2 dnl Copyright (C) 2004-2018 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 # Written by Jim Meyering.
9 AC_DEFUN([gl_FUNC_UNLINKAT],
11 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
12 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
13 AC_CHECK_FUNCS_ONCE([unlinkat])
14 AC_REQUIRE([gl_FUNC_UNLINK])
15 AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
16 if test $ac_cv_func_unlinkat = no; then
19 case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
21 # Solaris 9 has *at functions, but uniformly mishandles trailing
22 # slash in all of them.
26 # GNU/Hurd has unlinkat, but it has the same bug as unlink.
27 # Darwin has unlinkat, but it has the same UNLINK_PARENT_BUG.
28 if test $REPLACE_UNLINK = 1; then