From m.seaman@infracaninophile.co.uk  Sun Mar  7 20:23:02 2010
Return-Path: <m.seaman@infracaninophile.co.uk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B309106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Mar 2010 20:23:02 +0000 (UTC)
	(envelope-from m.seaman@infracaninophile.co.uk)
Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 265B78FC14
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Mar 2010 20:23:01 +0000 (UTC)
Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1])
	by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id o27KMu89094305
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 7 Mar 2010 20:22:57 GMT
	(envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk)
Received: (from matthew@localhost)
	by happy-idiot-talk.infracaninophile.co.uk (8.14.4/8.14.4/Submit) id o27KMuTd094304;
	Sun, 7 Mar 2010 20:22:56 GMT
	(envelope-from matthew)
Message-Id: <201003072022.o27KMuTd094304@happy-idiot-talk.infracaninophile.co.uk>
Date: Sun, 7 Mar 2010 20:22:56 GMT
From: Matthew Seaman <m.seaman@infracaninophile.co.uk>
Reply-To: Matthew Seaman <m.seaman@infracaninophile.co.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] fdescfs(5) and devfs(5) both provide /dev/fd/{0,1,2} files
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         144534
>Category:       docs
>Synopsis:       [patch] fdescfs(5) and devfs(5) both provide /dev/fd/{0,1,2} files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gjb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 07 20:30:00 UTC 2010
>Closed-Date:    Sat Feb 12 17:59:20 UTC 2011
>Last-Modified:  Sat Feb 12 18:00:35 UTC 2011
>Originator:     Matthew Seaman
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
Infracaninophile
>Environment:
System: FreeBSD happy-idiot-talk.infracaninophile.co.uk 8.0-STABLE FreeBSD 8.0-STABLE #20: Sat Feb 27 16:19:23 GMT 2010 root@happy-idiot-talk.infracaninophile.co.uk:/usr/obj/usr/src/sys/HAPPY-IDIOT-TALK i386


	
>Description:

There is a significant overlap in functionality between fdescfs(5) and
devfs(5): both will populate /dev/fd with charcter device files
corresponding to the open file descriptors of the process reading the
directory.

Yet there is no cross reference between the two man pages, nor is
there any discussion of an important difference between the two.
devfs(5) only provides the character special files corresponding to
the standard descriptors 0, 1 and 2; whereas fdescfs(5) provides files
for all open descriptors.

Refs:

http://lists.freebsd.org/pipermail/freebsd-fs/2006-August/002214.html

Discussion in ports/144502


>How-To-Repeat:
	
>Fix:

	

--- devfs.5.diff begins here ---
--- devfs.5.orig	2010-03-07 19:46:38.000000000 +0000
+++ devfs.5	2010-03-07 20:06:40.000000000 +0000
@@ -69,6 +69,21 @@
 .Xr mknod 8
 tool can be used to recover deleted device entries under
 .Nm .
+.Pp
+The
+.Xr fdescfs 5
+filesystem is an alternate means for creating character device files under 
+.Pa /dev/fd
+which correspond to the open file descriptors of the process reading
+the directory.
+.Nm
+only creates files for the standard file descriptors
+.Pa 0 ,
+.Pa 1
+and
+.Pa 2 .
+.Xr fdescfs 5
+creates files for all open descriptors.
 .Sh FILES
 .Bl -tag -width /dev/XXXX -compact
 .It Pa /dev
@@ -85,6 +100,7 @@
 .Dl "mount -t devfs devfs /dev"
 .Sh SEE ALSO
 .Xr devfs 8 ,
+.Xr fdescfs 5 ,
 .Xr mount 8
 .Sh HISTORY
 The
--- devfs.5.diff ends here ---

--- fdescfs.5.diff begins here ---
--- fdescfs.5.orig	2010-03-07 19:16:17.000000000 +0000
+++ fdescfs.5	2010-03-07 19:45:28.000000000 +0000
@@ -87,6 +87,15 @@
 and
 .Dv O_RDWR
 are ignored.
+.Pp
+NOTE: 
+.Pa /dev/fd/0 ,
+.Pa /dev/fd/1 
+and
+.Pa /dev/fd/2
+files are created by default when devfs alone is mounted.
+.Nm
+creates entries for all file descriptors opened by the process.
 .Sh EXAMPLES
 To mount a  
 .Nm
@@ -99,7 +108,8 @@
 .It Pa /dev/fd/#
 .El
 .Sh SEE ALSO
-.Xr mount 8
+.Xr mount 8 ,
+.Xr devfs 5
 .Sh HISTORY
 The
 .Nm
--- fdescfs.5.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-doc->gjb 
Responsible-Changed-By: gjb 
Responsible-Changed-When: Tue Sep 14 02:14:46 UTC 2010 
Responsible-Changed-Why:  
I'll take this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=144534 
State-Changed-From-To: open->patched 
State-Changed-By: gjb 
State-Changed-When: Sat Sep 18 19:23:30 UTC 2010 
State-Changed-Why:  
Patched in HEAD.  MFC in 1 week. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=144534 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144534: commit references a PR
Date: Sat, 18 Sep 2010 19:23:22 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Sat Sep 18 19:23:14 2010
 New Revision: 212827
 URL: http://svn.freebsd.org/changeset/base/212827
 
 Log:
   Note that devfs(5) and fdescfs(5) both create /dev/fd file descriptors.
   
   PR:		144534
   Submitted by:	Matthew Seaman <m.seaman at infracaninophile co uk>
   Patch by:	Matthew Seaman, keramida
   Approved by:	keramida (mentor)
   MFC after:	1 week
 
 Modified:
   head/share/man/man5/devfs.5
   head/share/man/man5/fdescfs.5
 
 Modified: head/share/man/man5/devfs.5
 ==============================================================================
 --- head/share/man/man5/devfs.5	Sat Sep 18 18:37:41 2010	(r212826)
 +++ head/share/man/man5/devfs.5	Sat Sep 18 19:23:14 2010	(r212827)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd May 30, 2010
 +.Dd September 18, 2010
  .Dt DEVFS 5
  .Os
  .Sh NAME
 @@ -69,6 +69,27 @@ The
  .Xr mknod 8
  tool can be used to recover deleted device entries under
  .Nm .
 +.Pp
 +The
 +.Xr fdescfs 5
 +filesystem is an alternate means for populating
 +.Pa /dev/fd .
 +The character devices that both
 +.Nm
 +and
 +.Xr fdescfs 5
 +present in
 +.Pa /dev/fd
 +correspond to the open file descriptors of the process
 +accessing the directory.
 +.Nm
 +only creates files for the standard file descriptors
 +.Pa 0 ,
 +.Pa 1
 +and
 +.Pa 2 .
 +.Xr fdescfs 5
 +creates files for all open descriptors.
  .Sh FILES
  .Bl -tag -width /dev/XXXX -compact
  .It Pa /dev
 @@ -85,6 +106,7 @@ volume located on
  .Dl "mount -t devfs devfs /mychroot/dev"
  .Sh SEE ALSO
  .Xr devfs 8 ,
 +.Xr fdescfs 5 ,
  .Xr mount 8
  .Sh HISTORY
  The
 
 Modified: head/share/man/man5/fdescfs.5
 ==============================================================================
 --- head/share/man/man5/fdescfs.5	Sat Sep 18 18:37:41 2010	(r212826)
 +++ head/share/man/man5/fdescfs.5	Sat Sep 18 19:23:14 2010	(r212827)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd December 14, 1996
 +.Dd September 18, 2010
  .Dt FDESCFS 5
  .Os
  .Sh NAME
 @@ -87,6 +87,15 @@ call other than
  and
  .Dv O_RDWR
  are ignored.
 +.Pp
 +.Em "Note:"
 +.Pa /dev/fd/0 ,
 +.Pa /dev/fd/1
 +and
 +.Pa /dev/fd/2
 +files are created by default when devfs alone is mounted.
 +.Nm
 +creates entries for all file descriptors opened by the process.
  .Sh FILES
  .Bl -tag -width /dev/stderr -compact
  .It Pa /dev/fd/#
 @@ -99,6 +108,7 @@ volume located on
  .Pp
  .Dl "mount -t fdescfs null /dev/fd"
  .Sh SEE ALSO
 +.Xr devfs 5 ,
  .Xr mount 8
  .Sh HISTORY
  The
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: gjb 
State-Changed-When: Sat Feb 12 17:58:52 UTC 2011 
State-Changed-Why:  
MFC'd to stable/8 and stable/7.  Thanks! 


http://www.freebsd.org/cgi/query-pr.cgi?pr=144534 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144534: commit references a PR
Date: Sat, 12 Feb 2011 17:58:02 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Sat Feb 12 17:57:56 2011
 New Revision: 218614
 URL: http://svn.freebsd.org/changeset/base/218614
 
 Log:
   MFC 212827, 217717:
   
   Note that devfs(5) and fdescfs(5) both create /dev/fd file descriptors.
   
   PR:		144534
   Approved by:	keramida (mentor)
 
 Modified:
   stable/8/share/man/man5/devfs.5
   stable/8/share/man/man5/fdescfs.5
 Directory Properties:
   stable/8/share/man/man5/   (props changed)
 
 Modified: stable/8/share/man/man5/devfs.5
 ==============================================================================
 --- stable/8/share/man/man5/devfs.5	Sat Feb 12 16:33:00 2011	(r218613)
 +++ stable/8/share/man/man5/devfs.5	Sat Feb 12 17:57:56 2011	(r218614)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd May 30, 2010
 +.Dd September 18, 2010
  .Dt DEVFS 5
  .Os
  .Sh NAME
 @@ -69,6 +69,27 @@ The
  .Xr mknod 8
  tool can be used to recover deleted device entries under
  .Nm .
 +.Pp
 +The
 +.Xr fdescfs 5
 +filesystem is an alternate means for populating
 +.Pa /dev/fd .
 +The character devices that both
 +.Nm
 +and
 +.Xr fdescfs 5
 +present in
 +.Pa /dev/fd
 +correspond to the open file descriptors of the process
 +accessing the directory.
 +.Nm
 +only creates files for the standard file descriptors
 +.Pa 0 ,
 +.Pa 1
 +and
 +.Pa 2 .
 +.Xr fdescfs 5
 +creates files for all open descriptors.
  .Sh FILES
  .Bl -tag -width /dev/XXXX -compact
  .It Pa /dev
 @@ -84,6 +105,7 @@ volume located on
  .Pp
  .Dl "mount -t devfs devfs /mychroot/dev"
  .Sh SEE ALSO
 +.Xr fdescfs 5 ,
  .Xr devfs 8 ,
  .Xr mount 8
  .Sh HISTORY
 
 Modified: stable/8/share/man/man5/fdescfs.5
 ==============================================================================
 --- stable/8/share/man/man5/fdescfs.5	Sat Feb 12 16:33:00 2011	(r218613)
 +++ stable/8/share/man/man5/fdescfs.5	Sat Feb 12 17:57:56 2011	(r218614)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd December 14, 1996
 +.Dd September 18, 2010
  .Dt FDESCFS 5
  .Os
  .Sh NAME
 @@ -87,6 +87,19 @@ call other than
  and
  .Dv O_RDWR
  are ignored.
 +.Pp
 +.Em "Note:"
 +.Pa /dev/fd/0 ,
 +.Pa /dev/fd/1
 +and
 +.Pa /dev/fd/2
 +files are created by default when devfs alone is mounted.
 +.Nm
 +creates entries for all file descriptors opened by the process.
 +.Sh FILES
 +.Bl -tag -width /dev/stderr -compact
 +.It Pa /dev/fd/#
 +.El
  .Sh EXAMPLES
  To mount a  
  .Nm
 @@ -94,11 +107,8 @@ volume located on
  .Pa /dev/fd :
  .Pp
  .Dl "mount -t fdescfs null /dev/fd"
 -.Sh FILES
 -.Bl -tag -width /dev/stderr -compact
 -.It Pa /dev/fd/#
 -.El
  .Sh SEE ALSO
 +.Xr devfs 5 ,
  .Xr mount 8
  .Sh HISTORY
  The
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/144534: commit references a PR
Date: Sat, 12 Feb 2011 17:58:41 +0000 (UTC)

 Author: gjb (doc committer)
 Date: Sat Feb 12 17:58:36 2011
 New Revision: 218615
 URL: http://svn.freebsd.org/changeset/base/218615
 
 Log:
   MFC 212827, 217717:
   
   Note that devfs(5) and fdescfs(5) both create /dev/fd file descriptors.
   
   PR:		144534
   Approved by:	keramida (mentor)
 
 Modified:
   stable/7/share/man/man5/devfs.5
   stable/7/share/man/man5/fdescfs.5
 Directory Properties:
   stable/7/share/man/man5/   (props changed)
 
 Modified: stable/7/share/man/man5/devfs.5
 ==============================================================================
 --- stable/7/share/man/man5/devfs.5	Sat Feb 12 17:57:56 2011	(r218614)
 +++ stable/7/share/man/man5/devfs.5	Sat Feb 12 17:58:36 2011	(r218615)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd May 30, 2010
 +.Dd September 18, 2010
  .Dt DEVFS 5
  .Os
  .Sh NAME
 @@ -69,6 +69,27 @@ The
  .Xr mknod 8
  tool can be used to recover deleted device entries under
  .Nm .
 +.Pp
 +The
 +.Xr fdescfs 5
 +filesystem is an alternate means for populating
 +.Pa /dev/fd .
 +The character devices that both
 +.Nm
 +and
 +.Xr fdescfs 5
 +present in
 +.Pa /dev/fd
 +correspond to the open file descriptors of the process
 +accessing the directory.
 +.Nm
 +only creates files for the standard file descriptors
 +.Pa 0 ,
 +.Pa 1
 +and
 +.Pa 2 .
 +.Xr fdescfs 5
 +creates files for all open descriptors.
  .Sh FILES
  .Bl -tag -width /dev/XXXX -compact
  .It Pa /dev
 @@ -84,6 +105,7 @@ volume located on
  .Pp
  .Dl "mount -t devfs devfs /mychroot/dev"
  .Sh SEE ALSO
 +.Xr fdescfs 5 ,
  .Xr devfs 8 ,
  .Xr mount 8
  .Sh HISTORY
 
 Modified: stable/7/share/man/man5/fdescfs.5
 ==============================================================================
 --- stable/7/share/man/man5/fdescfs.5	Sat Feb 12 17:57:56 2011	(r218614)
 +++ stable/7/share/man/man5/fdescfs.5	Sat Feb 12 17:58:36 2011	(r218615)
 @@ -38,7 +38,7 @@
  .\"
  .\" $FreeBSD$
  .\"
 -.Dd December 14, 1996
 +.Dd September 18, 2010
  .Dt FDESCFS 5
  .Os
  .Sh NAME
 @@ -87,6 +87,19 @@ call other than
  and
  .Dv O_RDWR
  are ignored.
 +.Pp
 +.Em "Note:"
 +.Pa /dev/fd/0 ,
 +.Pa /dev/fd/1
 +and
 +.Pa /dev/fd/2
 +files are created by default when devfs alone is mounted.
 +.Nm
 +creates entries for all file descriptors opened by the process.
 +.Sh FILES
 +.Bl -tag -width /dev/stderr -compact
 +.It Pa /dev/fd/#
 +.El
  .Sh EXAMPLES
  To mount a  
  .Nm
 @@ -94,11 +107,8 @@ volume located on
  .Pa /dev/fd :
  .Pp
  .Dl "mount -t fdescfs null /dev/fd"
 -.Sh FILES
 -.Bl -tag -width /dev/stderr -compact
 -.It Pa /dev/fd/#
 -.El
  .Sh SEE ALSO
 +.Xr devfs 5 ,
  .Xr mount 8
  .Sh HISTORY
  The
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
