2 # See if we need to provide mkfifoat/mknodat replacement.
4 dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
5 dnl This file is free software; the Free Software Foundation
6 dnl gives unlimited permission to copy and/or distribute it,
7 dnl with or without modifications, as long as this notice is preserved.
9 # Written by Eric Blake.
11 AC_DEFUN([gl_FUNC_MKFIFOAT],
13 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
14 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
16 dnl Persuade glibc <sys/stat.h> to declare mkfifoat() and mknodat().
17 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
19 AC_REQUIRE([gl_FUNC_OPENAT])
21 AC_CHECK_FUNCS_ONCE([mkfifoat mknodat])
22 if test $ac_cv_func_mkfifoat = yes; then
23 dnl Check for AIX 7.2 bug with trailing slash.
24 AC_CACHE_CHECK([whether mkfifoat rejects trailing slashes],
25 [gl_cv_func_mkfifoat_works],
33 if (!mkfifoat (AT_FDCWD, "conftest.tmp/", 0600))
38 [gl_cv_func_mkfifoat_works=yes],
39 [gl_cv_func_mkfifoat_works=no],
41 # Guess yes on Linux systems.
42 linux-* | linux) gl_cv_func_mkfifoat_works="guessing yes" ;;
43 # Guess yes on glibc systems.
44 *-gnu* | gnu*) gl_cv_func_mkfifoat_works="guessing yes" ;;
45 # Guess no on AIX systems.
46 aix*) gl_cv_func_mkfifoat_works="guessing no" ;;
47 # If we don't know, obey --enable-cross-guesses.
48 *) gl_cv_func_mkfifoat_works="$gl_cross_guess_normal" ;;
53 case "$gl_cv_func_mkfifoat_works" in
57 dnl mknodat() has the same bug as mkfifoat().
62 # No known system has mkfifoat but not mknodat