date and time created 91/04/12 13:40:31 by bostic
[unix-history] / usr / src / lib / libc / sys / getgid.2
.\" Copyright (c) 1983, 1991 Regents of the University of California.
.\" All rights reserved.
.\"
.\" %sccs.include.redist.man%
.\"
.\" @(#)getgid.2 6.3 (Berkeley) %G%
.\"
.Dd
.Dt GETGID 2
.Os BSD 4.2
.Sh NAME
.Nm getgid ,
.Nm getegid
.Nd get group process identification
.Sh SYNOPSIS
.Fd #include <sys/types.h>
.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 .