Bug 28929

Summary: [patch] No man page for pfind()
Product: Base System Reporter: Evan Sarmiento <kaworu>
Component: miscAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
pfind.9 none

Description Evan Sarmiento 2001-07-13 02:10:00 UTC
I have created a manpage for pfind(). Manpage pasted below:

Fix: 

.\" -*- nroff -*-
.\"
.\" Copyright (c) 1996 Doug Rabson
.\"
.\" All rights reserved.
.\"
.\" This program is free software.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 11, 2001
.Os
.Dt pfind 9
.Sh NAME
.Nm pfind
.Nd returns pointer to a proc structure in argument
.Sh SYNOPSIS
.Fd #include <sys/proc.h>
.Ft struct proc *
.Fn pfind "pid_t"
.Sh DESCRIPTION
.Pp
pfind takes a pid as its argument and returns a pointer to the proc structure wh
o's PID is the pid
specified in the argument
.Sh RETURN VALUES
pfind returns a pointer to a proc structure on success and a NULL on failure.
.Sh AUTHORS
This man page was written by
Evan Sarmiento.
Comment 1 dwmalone 2001-07-13 09:36:20 UTC
On Thu, Jul 12, 2001 at 06:03:49PM -0700, Evan Sarmiento wrote:
> I have created a manpage for pfind(). Manpage pasted below:

Sounds useful. I've a few small comments.

> >Fix:
> .\" -*- nroff -*-
> .\"
> .\" Copyright (c) 1996 Doug Rabson

I think you can assign the copyright of the manual page to yourself.
In -current I don't think calling pfind requires any locking in
-current 'cos it seems to do locking itself, but you might want to
check that with John Baldwin <jhb@freebsd.org>. Also, you should
probably ask Ruslan <ru@freebsd.org> to check the mdoc for you.

It might also be useful to document zpfind in the same man page?

	David.
Comment 2 Peter Pentchev freebsd_committer freebsd_triage 2001-07-13 10:11:48 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-doc

I believe this to be a doc issue. 
The manpage does need some mdoc(7) corrections, like, for instance.. 

--- pfind.9.orig        Fri Jul 13 12:17:00 2001 
+++ pfind.9     Fri Jul 13 12:18:08 2001 
@@ -37,11 +37,12 @@ 
.Fn pfind "pid_t" 
.Sh DESCRIPTION 
.Pp 
-pfind takes a pid as its argument and returns a pointer to the proc structure w 
h 
-o's PID is the pid 
-specified in the argument 
+.Nm 
+takes a pid as its argument and returns a pointer to the proc structure with 
+the specified process ID. 
.Sh RETURN VALUES 
-pfind returns a pointer to a proc structure on success and a NULL on failure. 
+.Nm 
+returns a pointer to a proc structure on success and a null pointer on failure. 
.Sh AUTHORS 
This man page was written by 
-Evan Sarmiento. 
+.An Evan Sarmiento . 

Also, the comments in the audit trail about the actual content seem relevant.
Comment 3 Evan Sarmiento 2001-07-13 15:23:52 UTC
Hello,

I have updated the pfind and zpfind manpage, hopefully, they are all correct now.

.\" -*- nroff -*-
.\"
.\" Copyright (c) 2001 Evan Sarmiento
.\"
.\" All rights reserved.
.\"
.\" This program is free software.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd July 11, 2001
.Os
.Dt pfind 9
.Sh NAME
.Nm pfind, zpfind
.Nd returns pointer to a proc structure in argument
.Sh SYNOPSIS
.Fd #include <sys/proc.h>
.Ft struct proc *
.Fn pfind "pid_t"
.Ft static struct proc *
.Fn zpfind "pid_t"
.Sh DESCRIPTION
.Pp
.Fn pfind
takes a pid as its argument and returns a pointer to the proc structure whose PID is
specified in the argument.
.Pp
.Nm
takes a pid as its argument. If zpfind finds a process whose pid is equal to that of argument and is
a zombie process, zpfind returns a pointer to that proc structure.
.Pp
Both zpfind and pfind lock the proc structure that is returned using
.Fn PROC_LOCK "p"
.Sh RETURN VALUES
.Nm
and
.Nm zpfind
both return a pointer to a locked proc structure on success and a NULL on failure.
.Sh AUTHORS
This man page was written by
.An Evan Sarmiento .
Comment 4 ru freebsd_committer freebsd_triage 2001-07-13 15:46:57 UTC
On Fri, Jul 13, 2001 at 10:04:22AM -0400, Evan Sarmiento wrote:
> 
> Hello,
> 
> I have edited the manpage a bit. And I also looked at the current source a bit,
> it does lock the proc structure. Here is my updated manpage.
> 
Here's the cleaned up version module one technical question.
It is my understanding from reading the code that pfind()
will only locate processes that are on the `allproc' list
(i.e., either runnable or sleeping), but not if the process
is on `zombproc' list.  Right?  The manpage is silent on this.

Please also tell me your e-mail address (if desired) to be
included into the manpage's AUTHORS section.


Cheers,
-- 
Ruslan Ermilov		Oracle Developer/DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age
Comment 5 Evan Sarmiento 2001-07-13 21:04:14 UTC
Hello again,

You're right about the allproc and zombproc thing. I've included them in the
man page now. I've also included my email address at the bottom.

Here is the diff.

--- pfind       Thu Jul 12 04:00:58 2001
+++ pfind.orig  Thu Jul 12 04:05:15 2001
@@ -38,13 +38,9 @@
 .Fn pfind
 takes a
 .Fa pid
-has its argument and returns a pointer to the
+as its argument and returns a pointer to the
 .Vt proc
-structure whose PID is specified in the argument only if the
-.Fa pid
-is on the 
-.Vt allproc
-list
+structure whose PID is specified in the argument.
 .Pp
 .Fn zpfind
 takes a
@@ -53,9 +49,7 @@
 If
 .Fn zpfind
 finds a process whose PID is equal to that of argument
-and is a zombie process, meaning that it must reside on the
-.Vt zombproc
 .Pp
 .Fn zpfind
 takes a
@@ -53,9 +49,7 @@
 If
 .Fn zpfind
 finds a process whose PID is equal to that of argument
-and is a zombie process, meaning that it must reside on the
-.Vt zombproc
-list
+and is a zombie process,
 .Fn zpfind
 returns a pointer to that
 .Vt proc
@@ -80,7 +74,8 @@
 on failure.
 .Sh AUTHORS
 This man page was written by
-.An Evan Sarmiento (kaworu@sektor7.ath.cx) .
+.An Evan Sarmiento .
  
+--lrZ03NoBR/3+SXJZ--

Thank you,
Evan Sarmiento
Comment 6 ru freebsd_committer freebsd_triage 2001-07-16 08:01:27 UTC
State Changed
From-To: open->closed

Added, thanks! 


Comment 7 ru freebsd_committer freebsd_triage 2001-07-16 08:01:27 UTC
Responsible Changed
From-To: freebsd-doc->ru