---
name: "pgfind"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pgfind"
---

# pgfind(9)

locate a process group by number

## NAME

**pgfind** – locate a process group by number

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/proc.h\>**

*struct pgrp \**\

**pgfind**(*pid\_t pgid*);

## DESCRIPTION

The **pgfind**() function takes a *pgid* as its argument and returns a pointer to the *pgrp* structure whose *pg\_id* is specified in the argument.

**pgfind**() locks the *pgrp* structure that is returned.

## RETURN VALUES

The **pgfind**() function returns NULL on failure or a pointer to a *pgrp* structure on successful completion.

## SEE ALSO

[pfind(9)](/pfind/9.md)

## AUTHORS

This manual page was written by Evan Sarmiento ⟨*kaworu@sektor7.ath.cx*⟩.
