Debian Codegraph @

upstream/debian-trixie/man2/getgid.2

raw
1 .\" Copyright 1993 Rickard E. Faith ([email protected])
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH getgid 2 2024-05-02 "Linux man-pages 6.9.1"
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 .P
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 .P
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 VERSIONS
31 On Alpha, instead of a pair of
32 .BR getgid ()
33 and
34 .BR getegid ()
35 system calls, a single
36 .BR getxgid ()
37 system call is provided, which returns a pair of real and effective GIDs.
38 The glibc
39 .BR getgid ()
40 and
41 .BR getegid ()
42 wrapper functions transparently deal with this.
43 See
44 .BR syscall (2)
45 for details regarding register mapping.
46 .SH STANDARDS
47 POSIX.1-2008.
48 .SH HISTORY
49 POSIX.1-2001, 4.3BSD.
50 .P
51 The original Linux
52 .BR getgid ()
53 and
54 .BR getegid ()
55 system calls supported only 16-bit group IDs.
56 Subsequently, Linux 2.4 added
57 .BR getgid32 ()
58 and
59 .BR getegid32 (),
60 supporting 32-bit IDs.
61 The glibc
62 .BR getgid ()
63 and
64 .BR getegid ()
65 wrapper functions transparently deal with the variations across kernel versions.
66 .SH SEE ALSO
67 .BR getresgid (2),
68 .BR setgid (2),
69 .BR setregid (2),
70 .BR credentials (7)