ggeettggrroouuppss() -- System Call (libc)

Read the supplemental group-access list
#iinncclluuddee <uunniissttdd.hh>
iinntt ggeettggrroouuppss(_g_i_d_s_e_t_s_i_z_e, _g_r_o_u_p_l_i_s_t)
iinntt _g_i_d_s_e_t_s_i_z_e; ggiidd_tt *_g_r_o_u_p_l_i_s_t;

The  ``supplemental group-access  list'' is the  list of  group identifiers
that  are  used  in   addition  to  the  effective  group  identifier  when
determining the level of access that  a process has to a file.  ggeettggrroouuppss()
reads the identifiers  from the current process's supplemental group-access
list, and writes them into the array to which _g_r_o_u_p_l_i_s_t points.

_g_r_o_u_p_l_i_s_t has _g_i_d_s_e_t_s_i_z_e entries, and must be large enough to contain every
entry from  the list.  The list cannot have  more than NNGGRROOUUPPSS_MMAAXX entries.
If  _g_i_d_s_e_t_s_i_z_e equals  zero, ggeettggrroouuppss()  returns the  number of  groups to
which  the calling  process belongs  without modifying  the array  to which
_g_r_o_u_p_l_i_s_t points.

If  all goes  well, ggeettggrroouuppss() returns  the number  of supplementary-group
identifiers  set for  the  calling process.   It  fails and  returns -1  if
_g_i_d_s_e_t_s_i_z_e is greater than zero  but less than the number of supplementary-
group identifiers set for the calling process, or if _g_r_o_u_p_l_i_s_t points to an
illegal address.  In  the former instance, it sets eerrrrnnoo  to EEIINNVVAALL; in the
latter, it sets eerrrrnnoo to EEFFAAUULLTT.

_S_e_e _A_l_s_o
lliibbcc, sseettggrroouuppss(), uunniissttdd.hh
POSIX Standard, section 4.2.3
