kern/120869: [procfs] 'stat' shows that all files have 0-length when they are actually not empty

Bruce Evans brde at optusnet.com.au
Thu Feb 21 10:20:05 UTC 2008


The following reply was made to PR kern/120869; it has been noted by GNATS.

From: Bruce Evans <brde at optusnet.com.au>
To: Robert Watson <rwatson at FreeBSD.org>
Cc: Bruce Evans <brde at optusnet.com.au>, remko at FreeBSD.org,
        freebsd-fs at FreeBSD.org, yuri at tsoft.com, bug-followup at FreeBSD.org
Subject: Re: kern/120869: [procfs] 'stat' shows that all files have 0-length
 when they are actually not empty
Date: Thu, 21 Feb 2008 21:11:46 +1100 (EST)

 On Thu, 21 Feb 2008, Robert Watson wrote:
 
 > On Thu, 21 Feb 2008, Bruce Evans wrote:
 >>> [about files in procfs]
 >> The bug is mainly that stat() claims that the files are regular when they 
 >> highly irregular (they are more like fifos).  This confuses naive 
 >> applications into thinking that normal access methods for regular files 
 >> actually work.
 >
 > I feel this way more generally about synthetic file systems with objects in 
 > them that don't correspond with any of the standard file system objects that 
 > applications known how to deal with.
 
 Enough to break compatibility/portabiility by adding a new file type? :-)
 S_IFMT has 4 bits, so it could encode 16 file types, but it currently only
 encodes 8.  It looks like it once had only 3 bits but was expanded for
 fifos.  It was last changed in ~1993 in 4.4BSD to add whiteouts.
 
 Bruce


More information about the freebsd-fs mailing list