4 dnl If you use this macro in a package, you should
5 dnl add the following two lines to acconfig.h:
6 dnl /* Define to rpl_getgroups if the replacement function should be used. */
10 AC_DEFUN(jm_FUNC_GETGROUPS,
11 [AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
12 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
13 AC_CHECK_FUNCS(getgroups)
14 # Run the program to test the functionality of the system-supplied
15 # getgroups function only if there is such a function.
16 if test $ac_cv_func_getgroups = yes; then
17 AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
22 /* On Ultrix 4.3, getgroups (0, 0) always fails. */
23 exit (getgroups (0, 0) == -1 ? 1 : 0);
26 jm_cv_func_working_getgroups=yes,
27 jm_cv_func_working_getgroups=no,
28 dnl When crosscompiling, assume getgroups is broken.
29 jm_cv_func_working_getgroups=no)
31 if test $jm_cv_func_working_getgroups = no; then
32 LIBOBJS="$LIBOBJS getgroups.o"
33 AC_DEFINE_UNQUOTED(getgroups, rpl_getgroups)