161181Sbostic.\" Copyright (c) 1983, 1991, 1993 261181Sbostic.\" The Regents of the University of California. All rights reserved. 320223Smckusick.\" 443568Strent.\" %sccs.include.redist.man% 520223Smckusick.\" 6*66830Sbostic.\" @(#)getgroups.2 8.2 (Berkeley) 04/16/94 738053Sbostic.\" 847208Scael.Dd 947208Scael.Dt GETGROUPS 2 1047208Scael.Os BSD 4.2 1147208Scael.Sh NAME 1247208Scael.Nm getgroups 1347208Scael.Nd get group access list 1447208Scael.Sh SYNOPSIS 1547208Scael.Fd #include <sys/param.h> 1647208Scael.Fd #include <unistd.h> 1747208Scael.Ft int 18*66830Sbostic.Fn getgroups "int gidsetlen" "gid_t *gidset" 1947208Scael.Sh DESCRIPTION 2047208Scael.Fn Getgroups 2120223Smckusickgets the current group access list of the user process 2220223Smckusickand stores it in the array 2347208Scael.Fa gidset . 2420223SmckusickThe parameter 2547208Scael.Fa gidsetlen 2623803Ssechrestindicates the number of entries that may be placed in 2747208Scael.Fa gidset . 2847208Scael.Fn Getgroups 2920224Smckusickreturns the actual number of groups returned in 3047208Scael.Fa gidset . 3147208ScaelNo more than 3247208Scael.Dv NGROUPS , 3347208Scaelas defined in 3447208Scael.Aq Pa sys/param.h , 3520223Smckusickwill ever 3620223Smckusickbe returned. 3747208Scael.Sh RETURN VALUES 3820224SmckusickA successful call returns the number of groups in the group set. 3947208ScaelA value of -1 indicates that an error occurred, and the error 4047208Scaelcode is stored in the global variable 4147208Scael.Va errno . 4247208Scael.Sh ERRORS 4347208ScaelThe possible errors for 4447208Scael.Fn getgroups 4547208Scaelare: 4647208Scael.Bl -tag -width Er 4747208Scael.It Bq Er EINVAL 4820224SmckusickThe argument 4947208Scael.Fa gidsetlen 5020224Smckusickis smaller than the number of groups in the group set. 5147208Scael.It Bq Er EFAULT 5247208ScaelThe argument 5347208Scael.Fa gidset 5447208Scaelspecifies 5520224Smckusickan invalid address. 5647208Scael.El 5747208Scael.Sh SEE ALSO 5847208Scael.Xr setgroups 2 , 5947208Scael.Xr initgroups 3 6047208Scael.Sh HISTORY 6147208ScaelThe 6247208Scael.Nm 6347208Scaelfunction call appeared in 6447208Scael.Bx 4.2 . 65