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

tfind, prfind, pgfindfind thread, process and process group by number

#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);

The (), (), and () functions retrieve thread, process and progress group structures from thread, process and process group IDs, respectively.

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

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

January 24, 2017 OpenBSD 7.5