getgroups: document portability issues
[gnulib.git] / doc / posix-functions / getgroups.texi
1 @node getgroups
2 @section @code{getgroups}
3 @findex getgroups
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/getgroups.html}
6
7 Gnulib module: getgroups
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 mingw, MSVC 9.
14 @item
15 On some platforms, this function fails to reject a negative count,
16 even though that is less than the size that would be returned:
17 FreeBSD 7.2.
18 @item
19 On Ultrix 4.3, @code{getgroups (0, NULL)} always fails.  See macro
20 @samp{AC_FUNC_GETGROUPS}.
21 @item
22 On very old systems, this function operated on an array of @samp{int},
23 even though that was a different size than an array of @samp{gid_t}.
24 @end itemize
25
26 Portability problems not fixed by Gnulib:
27 @itemize
28 @item
29 This function is unsafe to call between @code{fork} and @code{exec} if
30 the parent process is multi-threaded.
31 @item
32 It is unspecified whether the effective group id will be included in
33 the returned list, nor whether the list will be sorted in any
34 particular order.  For that matter, some platforms include the
35 effective group id twice, if it is also a member of the current
36 supplemental group ids.
37 @end itemize
38
39 The Gnulib module @code{mgetgroups} provides a similar API.