.\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %sccs.include.redist.man% .\" .\" @(#)getgid.2 8.1 (Berkeley) 06/04/93 .\" .Dd .Dt GETGID 2 .Os BSD 4.2 .Sh NAME .Nm getgid , .Nm getegid .Nd get group process identification .Sh SYNOPSIS .Fd #include .Ft gid_t .Fn getgid void .Ft gid_t .Fn getegid void .Sh DESCRIPTION The .Fn getgid function returns the real group ID of the calling process, .Fn getegid returns the effective group ID of the calling process. .Pp The real group ID is specified at login time. .Pp The real group ID is the group of the user who invoked the program. As the effective group ID gives the process additional permissions during the execution of .Dq Em set-group-ID mode processes, .Fn getgid is used to determine the real-user-id of the calling process. .Sh ERRORS The .Fn getgid and .Fn getegid functions are always successful, and no return value is reserved to indicate an error. .Sh SEE ALSO .Xr getuid 2 , .Xr setregid 2 , .Xr setgid 3 .Sh STANDARDS .Fn Getgid and .Fn getegid conform to IEEE Std 1003.1-1988 .Pq Dq Tn POSIX .