[lsb-discuss] Adding statfs interfaces

Nick Stoughton nick at usenix.org
Fri Dec 15 15:40:35 PST 2006


On Fri, 2006-12-15 at 23:56 +0100, Joerg Schilling wrote:

> >From Solaris man statvfs:
> 
Solaris has extended the statvfs structure (as POSIX permits) to include
f_basetype and f_fstr (and f_filler). Linux has not made these
extensions. I would strongly encourage the kernel team to do this, but
ultimately, the LSB describes what *is*, not what *should be* there!

>     The statvfs structure pointed to by buf includes the follow-
>      ing members:
> 
>      u_long      f_bsize;             /* preferred file system block size */
>      u_long      f_frsize;            /* fundamental filesystem block
>                                          (size if supported) */
>      fsblkcnt_t  f_blocks;            /* total # of blocks on file system
>                                          in units of f_frsize */
>      fsblkcnt_t  f_bfree;             /* total # of free blocks */
>      fsblkcnt_t  f_bavail;            /* # of free blocks avail to
>                                          non-privileged user */
>      fsfilcnt_t  f_files;             /* total # of file nodes (inodes) */
>      fsfilcnt_t  f_ffree;             /* total # of free file nodes */
>      fsfilcnt_t  f_favail;            /* # of inodes avail to
>                                          non-privileged user*/
>      u_long      f_fsid;              /* file system id (dev for now) */
>      char        f_basetype[FSTYPSZ]; /* target fs type name,
>                                          null-terminated */
>      u_long      f_flag;              /* bit mask of flags */
>      u_long      f_namemax;           /* maximum file name length */
>      char        f_fstr[32];          /* file system specific string */
>      u_long      f_filler[16];        /* reserved for future expansion */
> 

And from the Linux man statvfs:
         struct statvfs {
           unsigned long  f_bsize;    /* file system block size */
           unsigned long  f_frsize;   /* fragment size */
           fsblkcnt_t     f_blocks;   /* size of fs in f_frsize units */
           fsblkcnt_t     f_bfree;    /* # free blocks */
           fsblkcnt_t     f_bavail;   /* # free blocks for non-root */
           fsfilcnt_t     f_files;    /* # inodes */
           fsfilcnt_t     f_ffree;    /* # free inodes */
           fsfilcnt_t     f_favail;   /* # free inodes for non-root */
           unsigned long  f_fsid;     /* file system ID */
           unsigned long  f_flag;     /* mount flags */
           unsigned long  f_namemax;  /* maximum filename length */
         };


> There is no need to go back to statfs which was deprecated in 1992.
> 
I wish that were true!

-- 
Nick Stoughton                          Cell: 510 388 1413
USENIX Standards Liaison                Fax:  510 548 5738




More information about the lsb-discuss mailing list