Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PFIND(9)		   Kernel Developer's Manual		      PFIND(9)

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 *
       pfind_any(pid_t pid);

       struct proc *
       pfind_any_locked(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.

       pfind_any()  takes  a  pid  as  its argument.  pfind_any() searches the
       allproc list and	returns	the first process whose	PID matches and	 whose
       state is	PRS_ZOMBIE.

       pfind_any_locked()  is similar to pfind_any() ,but it does not lock the
       process hash bucket for the given pid.  Instead,	it asserts the	corre-
       sponding	 process  hash	bucket is already locked.  All three functions
       pfind(),	pfind_any(), and pgfind_any_locked() lock the  proc  structure
       before returning.

RETURN VALUES
       pfind(),	 pfind_any(),  and pfind_any_locked() return pointer to	a proc
       structure on success or NULL on failure.

SEE ALSO
       pgfind(9)

AUTHORS
       This manual page	was written by Evan Sarmiento <kaworu@sektor7.ath.cx>.

FreeBSD	15.0		       December	3, 2024			      PFIND(9)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=pfind&sektion=9&manpath=FreeBSD+15.0-RELEASE+and+Ports>

home | help