docs/144534: [patch] fdescfs(5) and devfs(5) both provide /dev/fd/{0, 1, 2} files

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Mar 7 20:30:01 UTC 2010


>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:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 07 20:30:00 UTC 2010
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-doc mailing list