.TH getgid() "" "" "System Call (libc)"
.PC "Get real group identifier"
.B "#include <unistd.h>"
.B getgid()
.PP
Every process has two different versions of its
.IR "user id" ,
called the
.I real
user id and the
.I effective
user id.
The user ids
determine eligibility to access files or
employ system privileges.
Normally, these two ids are identical.
However, for a
.I "set user id"
load module
(see
.BR exec ),
the real user id is that of the user,
whereas the effective user id is that of the
load module owner.
This distinction allows
system programs to use files which are protected from
the user who invokes the program.
.PP
.B getgid()
returns the real group id.
.SH "See Also"
.Xr "access()," access
.Xr "exec," exec
.Xr "getegid()," getegid
.Xr "geteuid()," geteuid
.Xr "getuid()," getuid
.Xr "libc," libc
.Xr "login," login
.Xr "setuid()," setuid
.Xr "unistd.h" unistd.h
.br
\*(PX \(sc4.2.1
