summaryrefslogtreecommitdiff
path: root/m4/jm-macros.m4
diff options
context:
space:
mode:
authorMarkus Duft <mduft@gentoo.org>2011-09-08 13:09:27 +0200
committerJim Meyering <meyering@redhat.com>2011-10-01 19:17:26 +0200
commit07498748d2808e47e4a513f190d74b86c14aa54c (patch)
tree225b21a135e9dc3fa56b0c86943254031836bee5 /m4/jm-macros.m4
parent7289f125886db5e900eed52a62e89de8f802863a (diff)
downloadcoreutils-07498748d2808e47e4a513f190d74b86c14aa54c.tar.gz
coreutils-07498748d2808e47e4a513f190d74b86c14aa54c.tar.bz2
coreutils-07498748d2808e47e4a513f190d74b86c14aa54c.zip
build: use getgr*_nomembers functions on Interix
Interix provides faster replacements for getgr{gid,nam,ent} where group member information is not fetched from domain controllers. This makes 'id' usable on domain controlled interix boxes. * m4/jm-macros.m4: Check for _nomembers functions. * src/system.h: Redefine function to _nomembers when available.
Diffstat (limited to 'm4/jm-macros.m4')
-rw-r--r--m4/jm-macros.m410
1 files changed, 10 insertions, 0 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 58b000d3f..dc68f3b61 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -89,6 +89,16 @@ AC_DEFUN([coreutils_MACROS],
tcgetpgrp \
)
+ # These checks are for Interix, to avoid its getgr* functions, in favor
+ # of these replacements. The replacement functions are much more efficient
+ # because they do not query the domain controller for user information
+ # when it is not needed.
+ AC_CHECK_FUNCS_ONCE([
+ getgrgid_nomembers
+ getgrnam_nomembers
+ getgrent_nomembers
+ ])
+
dnl This can't use AC_REQUIRE; I'm not quite sure why.
cu_PREREQ_STAT_PROG