Mercurial > hg > octave-jordi > gnulib-hg
annotate modules/group-member @ 12280:39be377f1765
getgroups: don't expose GETGROUPS_T to user
These days, most systems already declare getgroups with gid_t*.
But in the rare case that GETGROUPS_T is still int but gid_t
is short, the user should not have to uglify their code; let
the replacement hide all the magic.
Tested by configuring with ac_cv_type_getgroups=uint64_t on a
platform with 32-bit gid_t, and ignoring compiler warnings.
However, since we don't replace setgroups, the GETGROUPS_T
workaround is still needed there for now.
* lib/getgroups.c (rpl_getgroups): Change signature. Copy array
an element at a time if GETGROUPS_T is wrong size.
* lib/getugroups.h (getugroups): Change signature.
* lib/unistd.in.h (getgroups): Likewise.
* m4/getgroups.m4 (gl_FUNC_GETGROUPS): Use replacement if
signature needs fixing.
* m4/getugroups.m4 (gl_GETUGROUPS): No longer need
AC_TYPE_GETGROUPS.
* modules/group-member (Depends-on): Add getgroups.
* lib/group-member.c (group_info, get_group_info): Use gid_t.
(group_member): Rely on getgroups replacement.
* lib/getugroups.c (getugroups): Use gid_t.
* tests/test-getgroups.c (main): Likewise.
* NEWS: Mention the signature change.
* doc/posix-functions/getgroups.texi (getgroups): Mention the
problem with signature.
* doc/glibc-functions/setgroups.texi (setgroups): Mention that
GETGROUPS_T is still useful for setgroups.
Signed-off-by: Eric Blake <ebb9@byu.net>
author | Eric Blake <ebb9@byu.net> |
---|---|
date | Thu, 12 Nov 2009 10:19:39 -0700 |
parents | 5a0294ce5372 |
children | 8d8a6d8151f4 |
rev | line source |
---|---|
4110 | 1 Description: |
4172 | 2 Determine whether the current process has the permissions of a given group ID. |
4110 | 3 |
4 Files: | |
5 lib/group-member.h | |
6 lib/group-member.c | |
7 m4/group-member.m4 | |
8 | |
9 Depends-on: | |
9209
5a0294ce5372
Track CVS Autoconf on AC_USE_SYSTEM_EXTENSIONS.
Eric Blake <ebb9@byu.net>
parents:
7497
diff
changeset
|
10 extensions |
12280
39be377f1765
getgroups: don't expose GETGROUPS_T to user
Eric Blake <ebb9@byu.net>
parents:
9209
diff
changeset
|
11 getgroups |
4110 | 12 xalloc |
4830
410ea3e253b9
Revamp xalloc_oversized so that its count arg need not fit into size_t.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4197
diff
changeset
|
13 stdbool |
4110 | 14 |
15 configure.ac: | |
5016
7141ea4946af
Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents:
4830
diff
changeset
|
16 gl_FUNC_GROUP_MEMBER |
4110 | 17 |
18 Makefile.am: | |
19 | |
20 Include: | |
21 "group-member.h" | |
22 | |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5016
diff
changeset
|
23 License: |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5016
diff
changeset
|
24 GPL |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5016
diff
changeset
|
25 |
4197 | 26 Maintainer: |
27 Jim Meyering |