summaryrefslogtreecommitdiff
path: root/m4/euidaccess.m4
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-09-03 13:43:12 -0600
committerEric Blake <ebb9@byu.net>2009-09-03 21:20:48 -0600
commitbc366ae145683ca7ec1695c69cd2b4ed8f5bc589 (patch)
treee005f7ef3ec1ac6e03c5feff109eea2f40dbdf13 /m4/euidaccess.m4
parent4208951389e547545c43fc8c0daa42d0cf8b729e (diff)
downloadgnulib-bc366ae145683ca7ec1695c69cd2b4ed8f5bc589.tar.gz
euidaccess: prefer POSIX over non-standard implementation
* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Check for faccessat. * lib/euidaccess.c (euidaccess): Use it if available. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'm4/euidaccess.m4')
-rw-r--r--m4/euidaccess.m45
1 files changed, 4 insertions, 1 deletions
diff --git a/m4/euidaccess.m4 b/m4/euidaccess.m4
index 5882f5817c..f1a175cdca 100644
--- a/m4/euidaccess.m4
+++ b/m4/euidaccess.m4
@@ -1,4 +1,4 @@
-# euidaccess.m4 serial 10
+# euidaccess.m4 serial 11
dnl Copyright (C) 2002-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -31,6 +31,9 @@ AC_DEFUN([gl_FUNC_EUIDACCESS],
# Prerequisites of lib/euidaccess.c.
AC_DEFUN([gl_PREREQ_EUIDACCESS], [
+ dnl Prefer POSIX faccessat over non-standard euidaccess.
+ AC_CHECK_FUNCS_ONCE([faccessat])
+ dnl Try various other non-standard fallbacks.
AC_CHECK_HEADERS_ONCE([libgen.h])
AC_CHECK_DECLS_ONCE([setregid])
AC_REQUIRE([AC_FUNC_GETGROUPS])