Debian Codegraph @

upstream/debian-trixie/man3/group_member.3

raw
1 .\" Copyright (C) 2014, Michael Kerrisk <[email protected]>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH group_member 3 2024-05-02 "Linux man-pages 6.9.1"
6 .SH NAME
7 group_member \- test whether a process is in a group
8 .SH LIBRARY
9 Standard C library
10 .RI ( libc ", " \-lc )
11 .SH SYNOPSIS
12 .nf
13 .B #include <unistd.h>
14 .P
15 .BI "int group_member(gid_t " gid );
16 .fi
17 .P
18 .RS -4
19 Feature Test Macro Requirements for glibc (see
20 .BR feature_test_macros (7)):
21 .RE
22 .P
23 .BR group_member ():
24 .nf
25 _GNU_SOURCE
26 .fi
27 .SH DESCRIPTION
28 The
29 .BR group_member ()
30 function tests whether any of the caller's supplementary group IDs
31 (as returned by
32 .BR getgroups (2))
33 matches
34 .IR gid .
35 .SH RETURN VALUE
36 The
37 .BR group_member ()
38 function returns nonzero if any of the caller's
39 supplementary group IDs matches
40 .IR gid ,
41 and zero otherwise.
42 .SH STANDARDS
43 GNU.
44 .SH SEE ALSO
45 .BR getgid (2),
46 .BR getgroups (2),
47 .BR getgrouplist (3),
48 .BR group (5)