1 .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH GETGID 2 2021-03-22 "Linux" "Linux Programmer's Manual"
7 getgid, getegid \- get group identity
10 .RI ( libc ", " \-lc )
13 .B #include <unistd.h>
15 .B gid_t getgid(void);
16 .B gid_t getegid(void);
20 returns the real group ID of the calling process.
23 returns the effective group ID of the calling process.
25 These functions are always successful
27 .\" https://www.austingroupbugs.net/view.php?id=511
28 .\" 0000511: getuid and friends should not modify errno
31 POSIX.1-2001, POSIX.1-2008, 4.3BSD.
37 system calls supported only 16-bit group IDs.
38 Subsequently, Linux 2.4 added
42 supporting 32-bit IDs.
47 wrapper functions transparently deal with the variations across kernel versions.
49 On Alpha, instead of a pair of
53 system calls, a single
55 system call is provided, which returns a pair of real and effective GIDs.
60 wrapper functions transparently deal with this.
63 for details regarding register mapping.