poll tests: Avoid test failure on BSD and Solaris systems.
[gnulib.git] / doc / posix-functions / getgroups.texi
blobc4c919d0c1715370da98844f334b98d95b28eb91
1 @node getgroups
2 @section @code{getgroups}
3 @findex getgroups
5 POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/getgroups.html}
7 Gnulib module: getgroups
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 mingw, MSVC 14.
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 Mac OS X 10.13, FreeBSD 7.2.
18 @item
19 On NeXTstep 3.2, @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
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
39 The Gnulib module @code{mgetgroups} provides a similar API.