sigaction.2: Minor tweaks to Peter's patch
[man-pages.git] / man2 / getgid.2
bloba118ec2c3000dcdfc1907e0e452c81c3690dd303
1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .TH GETGID 2 2021-03-22 "Linux" "Linux Programmer's Manual"
26 .SH NAME
27 getgid, getegid \- get group identity
28 .SH SYNOPSIS
29 .nf
30 .B #include <unistd.h>
31 .PP
32 .B gid_t getgid(void);
33 .B gid_t getegid(void);
34 .fi
35 .SH DESCRIPTION
36 .BR getgid ()
37 returns the real group ID of the calling process.
38 .PP
39 .BR getegid ()
40 returns the effective group ID of the calling process.
41 .SH ERRORS
42 These functions are always successful
43 and never modify
44 .\" https://www.austingroupbugs.net/view.php?id=511
45 .\" 0000511: getuid and friends should not modify errno
46 .IR errno .
47 .SH CONFORMING TO
48 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
49 .SH NOTES
50 The original Linux
51 .BR getgid ()
52 and
53 .BR getegid ()
54 system calls supported only 16-bit group IDs.
55 Subsequently, Linux 2.4 added
56 .BR getgid32 ()
57 and
58 .BR getegid32 (),
59 supporting 32-bit IDs.
60 The glibc
61 .BR getgid ()
62 and
63 .BR getegid ()
64 wrapper functions transparently deal with the variations across kernel versions.
65 .PP
66 On Alpha, instead of a pair of
67 .BR getgid ()
68 and
69 .BR getegid ()
70 system calls, a single
71 .BR getxgid ()
72 system call is provided, which returns a pair of real and effective GIDs.
73 The glibc
74 .BR getgid ()
75 and
76 .BR getegid ()
77 wrapper functions transparently deal with this.
78 See
79 .BR syscall (2)
80 for details regarding register mapping.
81 .SH SEE ALSO
82 .BR getresgid (2),
83 .BR setgid (2),
84 .BR setregid (2),
85 .BR credentials (7)