getgroups: work around FreeBSD bug
authorEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 19:53:17 +0000 (12:53 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 19:53:17 +0000 (12:53 -0700)
commit1e642be936b3a09f6200d753f035ce045d9c5dac
tree84ba50304c612d75a74420415e5cefd74586062a
parentf3a2c4aaa9ad3ed11c1437cdce8ae172fd273a1f
getgroups: work around FreeBSD bug

FreeBSD 7.2 mistakenly succeeds on getgroups(-1,ptr) (POSIX
requires EINVAL failure since -1 is less than the proper result).

* lib/getgroups.c (rpl_getgroups): Work around the bug.
* m4/getgroups.m4 (gl_FUNC_GETGROUPS): Detect the bug.
* doc/posix-functions/getgroups.texi (getgroups): Document it.
* tests/test-getgroups.c (main): Fix buffer overrun.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/posix-functions/getgroups.texi
lib/getgroups.c
m4/getgroups.m4
tests/test-getgroups.c