Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/df Add -a flag now that we have support for MNT_IGNORE



details:   https://anonhg.NetBSD.org/src/rev/68c87cf4eb6e
branches:  trunk
changeset: 493911:68c87cf4eb6e
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 26 21:16:15 2000 +0000

description:
Add -a flag now that we have support for MNT_IGNORE

diffstat:

 bin/df/df.1 |  11 ++++++++---
 bin/df/df.c |  19 ++++++++++++++-----
 2 files changed, 22 insertions(+), 8 deletions(-)

diffs (101 lines):

diff -r 2a930968c17c -r 68c87cf4eb6e bin/df/df.1
--- a/bin/df/df.1       Mon Jun 26 21:10:34 2000 +0000
+++ b/bin/df/df.1       Mon Jun 26 21:16:15 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: df.1,v 1.17 1999/03/22 18:30:44 garbled Exp $
+.\"    $NetBSD: df.1,v 1.18 2000/06/26 21:16:15 christos Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -41,7 +41,7 @@
 .Nd display free disk space
 .Sh SYNOPSIS
 .Nm
-.Op Fl ikln
+.Op Fl aikln
 .Op Fl t Ar type
 .Op Ar file | Ar file_system ...
 .Sh DESCRIPTION
@@ -70,6 +70,10 @@
 .Pp
 The following options are available:
 .Bl -tag -width Ds
+.It Fl a
+Show all filesystems. By default only filesystems mounted with the
+.Dv MNT_IGNORE
+flag clear are shown.
 .It Fl i
 Include statistics on the number of free inodes.
 .It Fl k
@@ -78,7 +82,8 @@
 .Fl k
 option causes the numbers to be reported in kilobyte counts.
 .It Fl l
-Display statistics only about mounted file systems with the MNT_LOCAL
+Display statistics only about mounted file systems with the
+.Dv MNT_LOCAL
 flag set.  If a non-local file system is given as an argument, a
 warning is issued and no information is given on that file system.
 .It Fl n
diff -r 2a930968c17c -r 68c87cf4eb6e bin/df/df.c
--- a/bin/df/df.c       Mon Jun 26 21:10:34 2000 +0000
+++ b/bin/df/df.c       Mon Jun 26 21:16:15 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: df.c,v 1.33 1999/09/24 13:35:21 hubertf Exp $  */
+/*     $NetBSD: df.c,v 1.34 2000/06/26 21:16:16 christos Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -49,7 +49,7 @@
 #if 0
 static char sccsid[] = "@(#)df.c       8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.33 1999/09/24 13:35:21 hubertf Exp $");
+__RCSID("$NetBSD: df.c,v 1.34 2000/06/26 21:16:16 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,7 +79,7 @@
 long    regetmntinfo __P((struct statfs **, long));
 void    usage __P((void));
 
-int    iflag, kflag, lflag, nflag;
+int    aflag, iflag, kflag, lflag, nflag;
 char   **typelist = NULL;
 struct ufs_args mdev;
 
@@ -94,8 +94,11 @@
        int ch, i, maxwidth, width;
        char *mntpt;
 
-       while ((ch = getopt(argc, argv, "iklnt:")) != -1)
+       while ((ch = getopt(argc, argv, "aiklnt:")) != -1)
                switch (ch) {
+               case 'a':
+                       aflag = 1;
+                       break;
                case 'i':
                        iflag = 1;
                        break;
@@ -291,6 +294,8 @@
        mntbuf = *mntbufp;
        j = 0;
        for (i = 0; i < mntsize; i++) {
+               if (!aflag && (mntbuf[i].f_flags & MNT_IGNORE) != 0)
+                       continue;
                if (lflag && (mntbuf[i].f_flags & MNT_LOCAL) == 0)
                        continue;
                if (!selected(mntbuf[i].f_fstypename))
@@ -451,7 +456,11 @@
 void
 usage()
 {
-       (void)fprintf(stderr, "usage: df [-ikln] [-t type] [file | file_system ...]\n");
+       extern char *__progname;
+
+       (void)fprintf(stderr,
+           "Usage: %s [-aikln] [-t type] [file | file_system ...]\n",
+           __progname);
        exit(1);
        /* NOTREACHED */
 }



Home | Main Index | Thread Index | Old Index