]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da | 4 | .\" |
4c1c5274 | 5 | .TH getgid 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
6 | .SH NAME |
7 | getgid, getegid \- get group identity | |
35bba3c2 AC |
8 | .SH LIBRARY |
9 | Standard C library | |
8fc3b2cf | 10 | .RI ( libc ", " \-lc ) |
fea681da | 11 | .SH SYNOPSIS |
c7db92b9 | 12 | .nf |
fea681da | 13 | .B #include <unistd.h> |
68e4db0a | 14 | .PP |
fea681da | 15 | .B gid_t getgid(void); |
fea681da | 16 | .B gid_t getegid(void); |
c7db92b9 | 17 | .fi |
fea681da | 18 | .SH DESCRIPTION |
e511ffb6 | 19 | .BR getgid () |
a1ffe9f5 | 20 | returns the real group ID of the calling process. |
efeece04 | 21 | .PP |
e511ffb6 | 22 | .BR getegid () |
a1ffe9f5 | 23 | returns the effective group ID of the calling process. |
fea681da | 24 | .SH ERRORS |
b926779b MK |
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 . | |
3113c7f3 | 30 | .SH STANDARDS |
431e43bc | 31 | POSIX.1-2001, POSIX.1-2008, 4.3BSD. |
7c36affc MK |
32 | .SH NOTES |
33 | The original Linux | |
34 | .BR getgid () | |
35 | and | |
36 | .BR getegid () | |
37 | system calls supported only 16-bit group IDs. | |
c5662d5d | 38 | Subsequently, Linux 2.4 added |
7c36affc MK |
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. | |
70ea1968 | 48 | .PP |
03936fb4 | 49 | On Alpha, instead of a pair of |
b30b425b MK |
50 | .BR getgid () |
51 | and | |
52 | .BR getegid () | |
03936fb4 | 53 | system calls, a single |
70ea1968 ES |
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. | |
47297adb | 64 | .SH SEE ALSO |
24e45983 | 65 | .BR getresgid (2), |
fea681da | 66 | .BR setgid (2), |
24e45983 MK |
67 | .BR setregid (2), |
68 | .BR credentials (7) |