xref: /freebsd/share/man/man9/pfind.9 (revision 6137b5f7b8c183ee8806d79b3f1d8e5e3ddb3df3)
1.\" Copyright (c) 2001 Evan Sarmiento.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd July 11, 2001
26.Dt PFIND 9
27.Os
28.Sh NAME
29.Nm pfind , zpfind
30.Nd locate a process by number
31.Sh SYNOPSIS
32.In sys/param.h
33.In sys/proc.h
34.Ft "struct proc *"
35.Fn pfind "pid_t pid"
36.Ft "struct proc *"
37.Fn zpfind "pid_t pid"
38.Sh DESCRIPTION
39.Fn pfind
40takes a
41.Fa pid
42as its argument and returns a pointer to the
43.Vt proc
44structure whose PID is specified in the argument only if the
45.Fa pid
46is on the
47.Va allproc
48list.
49.Pp
50.Fn zpfind
51takes a
52.Fa pid
53as its argument.
54If
55.Fn zpfind
56finds a process whose PID is equal to that of argument
57and is a zombie process, meaning that it must reside on the
58.Va zombproc
59list,
60.Fn zpfind
61returns a pointer to that
62.Vt proc
63structure.
64.Pp
65Both
66.Fn pfind
67and
68.Fn zpfind
69lock the
70.Vt proc
71structure that is returned using
72.Fn PROC_LOCK "p" .
73.Sh RETURN VALUES
74.Fn pfind
75and
76.Fn zpfind
77return a pointer to a
78.Vt proc
79structure on success and a
80.Dv NULL
81on failure.
82.Sh SEE ALSO
83.Xr pgfind 9
84.Sh AUTHORS
85This manual page was written by
86.An Evan Sarmiento Aq Mt kaworu@sektor7.ath.cx .
87