1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH GETGID 2 2021-03-22 "Linux" "Linux Programmer's Manual"
27 getgid, getegid \- get group identity
30 .B #include <unistd.h>
32 .B gid_t getgid(void);
33 .B gid_t getegid(void);
37 returns the real group ID of the calling process.
40 returns the effective group ID of the calling process.
42 These functions are always successful
44 .\" https://www.austingroupbugs.net/view.php?id=511
45 .\" 0000511: getuid and friends should not modify errno
48 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
54 system calls supported only 16-bit group IDs.
55 Subsequently, Linux 2.4 added
59 supporting 32-bit IDs.
64 wrapper functions transparently deal with the variations across kernel versions.
66 On Alpha, instead of a pair of
70 system calls, a single
72 system call is provided, which returns a pair of real and effective GIDs.
77 wrapper functions transparently deal with this.
80 for details regarding register mapping.