This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Bug 2546] Changed - statvfs() implementation in glibc-2.1 is broken (fwd)


   Date: Fri, 7 May 1999 07:48:44 -0700 (PDT)
   From: hjl@lucon.org (H.J. Lu)

   It looks like it is wrong to set f_frsize to 0. df can deal with it.
   But not other programs. According to the Unix standard,

The Single UNIX Specification, Version 2 says in the description of
the fstatvfs and statvfs that

   It is unspecified whether all members of the statvfs structure have
   meaningful values on all file systems.

Thus with setting f_frsize to 0 we do conform to the specification.

Note that the fact that it is unspecified which members have
meaningfull values makes writing portable programs a nightmare, since
you'll have to check for all possible lossage.  Even worse, checking
may be impossible since the structure may very well contain random
junk.  It is also not clear what the f_blocks means if f_frsize does
not contain a meanigful value.

   I think we should set f_frsize to f_bsize since on Linux they are
   the same.

This is probably the best solution.

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]