| 1 |
# unlinkdir.m4 |
| 2 |
# serial 8 |
| 3 |
dnl Copyright (C) 2005-2007, 2009-2025 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. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
# Written by Paul Eggert. |
| 10 |
|
| 11 |
AC_DEFUN([gl_UNLINKDIR], |
| 12 |
[ |
| 13 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 14 |
AC_CHECK_HEADERS_ONCE([priv.h]) |
| 15 |
|
| 16 |
# The Hurd, the Linux kernel, the FreeBSD kernel version 2.2 and later, |
| 17 |
# Cygwin, and mingw never let anyone (even root) unlink directories. |
| 18 |
# If anyone knows of another system for which unlink can never |
| 19 |
# remove a directory, please report it to <[email protected]>. |
| 20 |
# Unfortunately this is difficult to test for, since it requires root access |
| 21 |
# and might create garbage in the file system, |
| 22 |
# so the code below simply relies on the kernel name and version number. |
| 23 |
case $host_os in |
| 24 |
gnu[[0-9]]* | \ |
| 25 |
linux-* | linux | \ |
| 26 |
freebsd2.2* | freebsd[[3-9]]* | freebsd[[1-9]][[0-9]]* | \ |
| 27 |
cygwin | \ |
| 28 |
mingw* | windows*) |
| 29 |
AC_DEFINE([UNLINK_CANNOT_UNLINK_DIR], [1], |
| 30 |
[Define to 1 if unlink (dir) cannot possibly succeed.]);; |
| 31 |
esac |
| 32 |
]) |