From d3102fa7de519677c917beb108a71b81ef9a8abc Mon Sep 17 00:00:00 2001 From: tgoodwin Date: Mon, 27 Jul 1998 13:26:37 +0000 Subject: add RC_FUNC_GETGROUPS configure magic --- acinclude.m4 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'acinclude.m4') diff --git a/acinclude.m4 b/acinclude.m4 index c8913a0..60ec318 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,3 +1,19 @@ +dnl This macro sets HAVE_POSIX_GETGROUPS if the +dnl getgroups() function accepts a zero first argument. +AC_DEFUN(RC_FUNC_GETGROUPS, [ + AC_CACHE_CHECK(for POSIX getgroups, rc_cv_func_posix_getgroups, AC_TRY_RUN([ +#include +#include +int main(void) { + return getgroups(0, (void *)0) == -1; +} + ], rc_cv_func_posix_getgroups=yes, rc_cv_func_posix_getgroups=no, rc_cv_func_posix_getgroups=yes)) + case "$rc_cv_func_posix_getgroups" in + yes) AC_DEFINE(HAVE_POSIX_GETGROUPS) ;; + esac +]) + + dnl The AC_FUNC_SETPGRP macro doesn't dnl #include , so it fails on OSF-1, where setpgrp dnl will happily accept arguments, but the protoype doesn't @@ -7,7 +23,9 @@ AC_DEFUN(RC_FUNC_SETPGRP, [ AC_CACHE_CHECK(for setpgrp that takes no arguments, ac_cv_func_setpgrp_void, AC_TRY_RUN([ #include /* If setpgrp() takes no arguments, this may fail to compile, but -if it compiles the call should succeed. */ +if it compiles the call should succeed. Note that the assignments +to ac_cv_func_setpgrp_void are the other way round from what you +would expect. */ int main(void) { return setpgrp(1,1) != -1; } -- cgit v1.2.3