Bug 144534 - [patch] fdescfs(5) and devfs(5) both provide /dev/fd/{0,1,2} files
Summary: [patch] fdescfs(5) and devfs(5) both provide /dev/fd/{0,1,2} files
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Books & Articles (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Glen Barber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-07 20:30 UTC by Matthew Seaman
Modified: 2015-07-13 12:08 UTC (History)
0 users

See Also:


Attachments
devfs.5.diff (732 bytes, patch)
2010-03-07 20:30 UTC, Matthew Seaman
no flags Details | Diff
file.diff (535 bytes, patch)
2010-03-07 20:30 UTC, Matthew Seaman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Seaman 2010-03-07 20:30:00 UTC
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
Comment 1 Glen Barber freebsd_committer freebsd_triage 2010-09-14 03:14:46 UTC
Responsible Changed
From-To: freebsd-doc->gjb

I'll take this.
Comment 2 dfilter service freebsd_committer freebsd_triage 2010-09-18 20:23:22 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"
Comment 3 Glen Barber freebsd_committer freebsd_triage 2010-09-18 20:23:30 UTC
State Changed
From-To: open->patched

Patched in HEAD.  MFC in 1 week.
Comment 4 dfilter service freebsd_committer freebsd_triage 2011-02-12 17:58:02 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"
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-02-12 17:58:41 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"
Comment 6 Glen Barber freebsd_committer freebsd_triage 2011-02-12 17:58:52 UTC
State Changed
From-To: patched->closed

MFC'd to stable/8 and stable/7.  Thanks!
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-06-29 14:42:12 UTC
A commit references this bug:

Author: brueffer
Date: Mon Jun 29 14:41:20 UTC 2015
New revision: 284929
URL: https://svnweb.freebsd.org/changeset/base/284929

Log:
  Fix issues that kept some of the examples from actually working.

  PR:		144534
  Submitted by:	Nicolas Edel
  MFC after:	1 week

Changes:
  head/share/examples/csh/dot.cshrc
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-07-13 12:05:34 UTC
A commit references this bug:

Author: brueffer
Date: Mon Jul 13 12:04:41 UTC 2015
New revision: 285448
URL: https://svnweb.freebsd.org/changeset/base/285448

Log:
  MFC: r284929

  Fix issues that kept some of the examples from actually working.

  PR:		144534
  Submitted by:	Nicolas Edel
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/share/examples/csh/dot.cshrc
Comment 9 commit-hook freebsd_committer freebsd_triage 2015-07-13 12:08:38 UTC
A commit references this bug:

Author: brueffer
Date: Mon Jul 13 12:07:53 UTC 2015
New revision: 285449
URL: https://svnweb.freebsd.org/changeset/base/285449

Log:
  MFC: r284929

  Fix issues that kept some of the examples from actually working.

  PR:		144534
  Submitted by:	Nicolas Edel

Changes:
_U  stable/9/share/examples/
_U  stable/9/share/examples/csh/
  stable/9/share/examples/csh/dot.cshrc