xref: /original-bsd/lib/libc/sys/getgid.2 (revision c3e32dec)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)getgid.2	8.1 (Berkeley) 06/04/93
7.\"
8.Dd
9.Dt GETGID 2
10.Os BSD 4.2
11.Sh NAME
12.Nm getgid ,
13.Nm getegid
14.Nd get group process identification
15.Sh SYNOPSIS
16.Fd #include <sys/types.h>
17.Ft gid_t
18.Fn getgid void
19.Ft gid_t
20.Fn getegid void
21.Sh DESCRIPTION
22The
23.Fn getgid
24function returns the real group ID of the calling process,
25.Fn getegid
26returns the effective group ID of the calling process.
27.Pp
28The real group ID is specified at login time.
29.Pp
30The real group ID is the group of the user who invoked the program.
31As the effective group ID gives the process additional permissions
32during the execution of
33.Dq Em set-group-ID
34mode processes,
35.Fn getgid
36is used to determine the real-user-id of the calling process.
37.Sh ERRORS
38The
39.Fn getgid
40and
41.Fn getegid
42functions are always successful, and no return value is reserved to
43indicate an error.
44.Sh SEE ALSO
45.Xr getuid 2 ,
46.Xr setregid 2 ,
47.Xr setgid 3
48.Sh STANDARDS
49.Fn Getgid
50and
51.Fn getegid
52conform to IEEE Std 1003.1-1988
53.Pq Dq Tn POSIX .
54