---
name: "pfind"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/pfind"
---

# pfind(9)

locate a process by number

## NAME

**pfind**, **zpfind** – locate a process by number

## SYNOPSIS

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

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

*struct proc \**\

**pfind**(*pid\_t pid*);

*struct proc \**\

**zpfind**(*pid\_t pid*);

## DESCRIPTION

**pfind**() takes a *pid* as its argument and returns a pointer to the *proc* structure whose PID is specified in the argument only if the *pid* is on the *allproc* list.

**zpfind**() takes a *pid* as its argument. If **zpfind**() finds a process whose PID is equal to that of argument and is a zombie process, meaning that it must reside on the *zombproc* list, **zpfind**() returns a pointer to that *proc* structure.

Both **pfind**() and **zpfind**() lock the *proc* structure that is returned using **PROC\_LOCK**(*p*).

## RETURN VALUES

**pfind**() and **zpfind**() return a pointer to a *proc* structure on success and a NULL on failure.

## SEE ALSO

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

## AUTHORS

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