Commit | Line | Data |
---|---|---|
caefb263 KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
dbf001ae | 5 | .\" @(#)getgid.2 6.2 (Berkeley) %G% |
caefb263 | 6 | .\" |
6b00fd0f | 7 | .TH GETGID 2 "" |
caefb263 KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | getgid, getegid \- get group identity | |
11 | .SH SYNOPSIS | |
12 | .nf | |
13 | .ft B | |
dbf001ae KM |
14 | #include <sys/types.h> |
15 | .PP | |
16 | .nf | |
17 | .ft B | |
caefb263 | 18 | gid = getgid() |
dbf001ae | 19 | gid_t gid; |
caefb263 KM |
20 | .PP |
21 | .ft B | |
22 | egid = getegid() | |
dbf001ae | 23 | gid_t egid; |
caefb263 KM |
24 | .fi |
25 | .SH DESCRIPTION | |
26 | .I Getgid | |
27 | returns the real group ID of the current process, | |
28 | .I getegid | |
29 | the effective group ID. | |
30 | .PP | |
31 | The real group ID is specified at login time. | |
32 | .PP | |
33 | The effective group ID is more transient, and determines | |
34 | additional access permission during execution of a | |
35 | ``set-group-ID'' process, and it is for such processes | |
36 | that \fIgetgid\fP is most useful. | |
37 | .SH "SEE ALSO" | |
38 | getuid(2), setregid(2), setgid(3) |