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