]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man2/getgid.2
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man2 / getgid.2
CommitLineData
fea681da
MK
1.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2.\"
5fbde956 3.\" SPDX-License-Identifier: Linux-man-pages-copyleft
fea681da 4.\"
4c1c5274 5.TH getgid 2 (date) "Linux man-pages (unreleased)"
fea681da
MK
6.SH NAME
7getgid, getegid \- get group identity
35bba3c2
AC
8.SH LIBRARY
9Standard C library
8fc3b2cf 10.RI ( libc ", " \-lc )
fea681da 11.SH SYNOPSIS
c7db92b9 12.nf
fea681da 13.B #include <unistd.h>
68e4db0a 14.PP
fea681da 15.B gid_t getgid(void);
fea681da 16.B gid_t getegid(void);
c7db92b9 17.fi
fea681da 18.SH DESCRIPTION
e511ffb6 19.BR getgid ()
a1ffe9f5 20returns the real group ID of the calling process.
efeece04 21.PP
e511ffb6 22.BR getegid ()
a1ffe9f5 23returns the effective group ID of the calling process.
fea681da 24.SH ERRORS
b926779b
MK
25These functions are always successful
26and never modify
27.\" https://www.austingroupbugs.net/view.php?id=511
28.\" 0000511: getuid and friends should not modify errno
29.IR errno .
3113c7f3 30.SH STANDARDS
431e43bc 31POSIX.1-2001, POSIX.1-2008, 4.3BSD.
7c36affc
MK
32.SH NOTES
33The original Linux
34.BR getgid ()
35and
36.BR getegid ()
37system calls supported only 16-bit group IDs.
c5662d5d 38Subsequently, Linux 2.4 added
7c36affc
MK
39.BR getgid32 ()
40and
41.BR getegid32 (),
42supporting 32-bit IDs.
43The glibc
44.BR getgid ()
45and
46.BR getegid ()
47wrapper functions transparently deal with the variations across kernel versions.
70ea1968 48.PP
03936fb4 49On Alpha, instead of a pair of
b30b425b
MK
50.BR getgid ()
51and
52.BR getegid ()
03936fb4 53system calls, a single
70ea1968
ES
54.BR getxgid ()
55system call is provided, which returns a pair of real and effective GIDs.
56The glibc
57.BR getgid ()
58and
59.BR getegid ()
60wrapper functions transparently deal with this.
61See
62.BR syscall (2)
63for details regarding register mapping.
47297adb 64.SH SEE ALSO
24e45983 65.BR getresgid (2),
fea681da 66.BR setgid (2),
24e45983
MK
67.BR setregid (2),
68.BR credentials (7)