---
name: "group_member"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/group_member"
---

# group\_member(3)

test whether a process is in a group

## NAME

group\_member - test whether a process is in a group

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <unistd.h>
```

**int group\_member(gid\_t** *gid***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

**group\_member**():

```
    _GNU_SOURCE
```

## DESCRIPTION

The **group\_member**() function tests whether any of the caller's supplementary group IDs (as returned by [**getgroups**(2)](/getgroups/2.md)) matches *gid*.

## RETURN VALUE

The **group\_member**() function returns nonzero if any of the caller's supplementary group IDs matches *gid*, and zero otherwise.

## STANDARDS

GNU.

## SEE ALSO

[**getgid**(2)](/getgid/2.md), [**getgroups**(2)](/getgroups/2.md), [**getgrouplist**(3)](/getgrouplist/3.md), [**group**(5)](/group/5.md)
