From owner-freebsd-doc@FreeBSD.ORG Tue May 6 06:20:14 2003 Return-Path: Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D019837B401 for ; Tue, 6 May 2003 06:20:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A508D43FBD for ; Tue, 6 May 2003 06:20:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h46DKDUp033271 for ; Tue, 6 May 2003 06:20:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h46DKDJh033270; Tue, 6 May 2003 06:20:13 -0700 (PDT) Resent-Date: Tue, 6 May 2003 06:20:13 -0700 (PDT) Resent-Message-Id: <200305061320.h46DKDJh033270@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Lukas Ertl Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AB1B37B401 for ; Tue, 6 May 2003 06:17:04 -0700 (PDT) Received: from mailbox.univie.ac.at (mail.univie.ac.at [131.130.1.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC89D43FAF for ; Tue, 6 May 2003 06:17:02 -0700 (PDT) (envelope-from le@univie.ac.at) Received: from korben.in.tern (pcle.cc.univie.ac.at [131.130.2.107]) by mailbox.univie.ac.at (8.12.2/8.12.2) with ESMTP id h46DGhov165124 for ; Tue, 6 May 2003 15:16:50 +0200 Received: from korben.in.tern (korben.in.tern [127.0.0.1]) by korben.in.tern (8.12.9/8.12.9) with ESMTP id h46DGdUx018634 for ; Tue, 6 May 2003 15:16:39 +0200 (CEST) (envelope-from le@korben.in.tern) Received: (from le@localhost) by korben.in.tern (8.12.9/8.12.9/Submit) id h46DGcPt018633; Tue, 6 May 2003 15:16:38 +0200 (CEST) (envelope-from le) Message-Id: <200305061316.h46DGcPt018633@korben.in.tern> Date: Tue, 6 May 2003 15:16:38 +0200 (CEST) From: Lukas Ertl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/51845: [PATCH] catch up getfsstat.2 and statfs.2 with reality X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Lukas Ertl List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 May 2003 13:20:15 -0000 >Number: 51845 >Category: docs >Synopsis: [PATCH] catch up getfsstat.2 and statfs.2 with reality >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Tue May 06 06:20:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Lukas Ertl >Release: FreeBSD 5.1-BETA i386 >Organization: Vienna University Computer Center >Environment: System: FreeBSD korben 5.1-BETA FreeBSD 5.1-BETA #0: Tue May 6 12:01:11 CEST 2003 le@korben:/usr/obj/usr/src/sys/KORBEN i386 >Description: As already commented in sys/mount.h, getfsstat.2 and statfs.2 are out of sync with sys/mount.h. >How-To-Repeat: Compare sys/mount.h with getfsstat.2 and statfs.2. >Fix: --- mount.h.diff begins here --- Index: sys/sys/mount.h =================================================================== RCS file: /u/cvs/cvs/src/sys/sys/mount.h,v retrieving revision 1.147 diff -u -r1.147 mount.h --- sys/sys/mount.h 26 Mar 2003 22:15:58 -0000 1.147 +++ sys/sys/mount.h 6 May 2003 13:12:50 -0000 @@ -67,8 +67,6 @@ #define MFSNAMELEN 16 /* length of fs type name, including null */ #define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ -/* XXX getfsstat.2 is out of date with write and read counter changes here. */ -/* XXX statfs.2 is out of date with read counter changes here. */ struct statfs { long f_spare2; /* placeholder */ long f_bsize; /* fundamental filesystem block size */ Index: lib/libc/sys/getfsstat.2 =================================================================== RCS file: /u/cvs/cvs/src/lib/libc/sys/getfsstat.2,v retrieving revision 1.14 diff -u -r1.14 getfsstat.2 --- lib/libc/sys/getfsstat.2 19 Dec 2002 09:40:24 -0000 1.14 +++ lib/libc/sys/getfsstat.2 6 May 2003 13:12:50 -0000 @@ -65,25 +65,31 @@ */ #define MFSNAMELEN 16 /* length of fs type name, including null */ -#define MNAMELEN 90 /* length of buffer for returned name */ +#define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ struct statfs { - long f_spare2; /* placeholder */ - long f_bsize; /* fundamental file system block size */ - long f_iosize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - fsid_t f_fsid; /* file system id */ - uid_t f_owner; /* user that mounted the file system */ - int f_type; /* type of file system (see below) */ - int f_flags; /* copy of mount flags */ - long f_spare[2]; /* spare for later */ - char f_fstypename[MFSNAMELEN];/* fs type name */ - char f_mntonname[MNAMELEN];/* directory on which mounted */ - char f_mntfromname[MNAMELEN];/* mounted file system */ + long f_spare2; /* placeholder */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + uid_t f_owner; /* user that mounted the file system */ + int f_type; /* type of file system (see below) */ + int f_flags; /* copy of mount exported flags */ + long f_syncwrites; /* count of sync writes since mount */ + long f_asyncwrites; /* count of async writes since mount */ + char f_fstypename[MFSNAMELEN];/* fs type name */ + char f_mntonname[MNAMELEN];/* directory on which mounted */ + long f_syncreads; /* count of sync reads since mount */ + long f_asyncreads; /* count of async reads since mount */ + short f_spares1; /* unused spare */ + char f_mntfromname[MNAMELEN];/* mounted filesystem */ + short f_spares2; /* unused spare */ + long f_spare[2]; /* unused spare */ }; .Ed .Pp Index: lib/libc/sys/statfs.2 =================================================================== RCS file: /u/cvs/cvs/src/lib/libc/sys/statfs.2,v retrieving revision 1.21 diff -u -r1.21 statfs.2 --- lib/libc/sys/statfs.2 19 Dec 2002 09:40:25 -0000 1.21 +++ lib/libc/sys/statfs.2 6 May 2003 13:12:50 -0000 @@ -70,27 +70,31 @@ */ #define MFSNAMELEN 16 /* length of fs type name, including null */ -#define MNAMELEN 90 /* length of buffer for returned name */ +#define MNAMELEN (88 - 2 * sizeof(long)) /* size of on/from name bufs */ struct statfs { -long f_bsize; /* fundamental file system block size */ -long f_iosize; /* optimal transfer block size */ -long f_blocks; /* total data blocks in file system */ -long f_bfree; /* free blocks in fs */ -long f_bavail; /* free blocks avail to non-superuser */ -long f_files; /* total file nodes in file system */ -long f_ffree; /* free file nodes in fs */ -fsid_t f_fsid; /* file system id */ -uid_t f_owner; /* user that mounted the file system */ -int f_type; /* type of file system */ -int f_flags; /* copy of mount flags */ -long f_syncwrites; /* count of sync writes since mount */ -long f_asyncwrites; /* count of async writes since mount */ -char f_fstypename[MFSNAMELEN];/* fs type name */ -char f_mntonname[MNAMELEN]; /* mount point */ -long f_syncreads; /* count of sync reads since mount */ -long f_asyncreads; /* count of async reads since mount */ -char f_mntfromname[MNAMELEN]; /* mounted file system */ + long f_spare2; /* placeholder */ + long f_bsize; /* fundamental file system block size */ + long f_iosize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + fsid_t f_fsid; /* file system id */ + uid_t f_owner; /* user that mounted the file system */ + int f_type; /* type of file system (see below) */ + int f_flags; /* copy of mount exported flags */ + long f_syncwrites; /* count of sync writes since mount */ + long f_asyncwrites; /* count of async writes since mount */ + char f_fstypename[MFSNAMELEN];/* fs type name */ + char f_mntonname[MNAMELEN];/* directory on which mounted */ + long f_syncreads; /* count of sync reads since mount */ + long f_asyncreads; /* count of async reads since mount */ + short f_spares1; /* unused spare */ + char f_mntfromname[MNAMELEN];/* mounted filesystem */ + short f_spares2; /* unused spare */ + long f_spare[2]; /* unused spare */ }; .Ed The flags that may be returned include: --- mount.h.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: