TFIND(9) | Kernel Developer's Manual | TFIND(9)

# NAME

`tfind`, `prfind`, `pgfind` — find thread, process and process group by number

# SYNOPSIS

`#include <sys/types.h>`
`#include <sys/signal.h>`
`#include <sys/proc.h>`

struct proc *
`tfind`(pid_t tid);

struct process *
`prfind`(pid_t pid);

struct pgrp *
`pgfind`(pid_t pgid);

# DESCRIPTION

The `tfind`(), `prfind`(), and `pgfind`() functions retrieve thread, process and process group structures from thread, process and process group IDs, respectively.

These functions return `NULL` if the requested ID can't be found.

# CODE REFERENCES

Those functions are implemented in the file sys/kern/kern_proc.c.

June 13, 2025 | Debian