diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-05-31 17:34:56 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-05-31 17:34:56 +0000 |
commit | bc8362e4ef1c185f7c1d9aec69d91f269c97d4e2 (patch) | |
tree | 9194d1773b772347d76766611948ee38e1002058 /bin/df | |
parent | 7a1b6dcd69cb5defd76dca41d6f8252a3140fb91 (diff) |
New struct statfs with mount options. NOTE: this replaces statfs(2),
fstatfs(2), and getfsstat(2) so you will need to build a new kernel
before doing a "make build" or you will get "unimplemented syscall" errors.
The new struct statfs has the following featuires:
o Has a u_int32_t flags field--now softdep can have a real flag.
o Uses u_int32_t instead of longs (nicer on the alpha). Note: the man
page used to lie about setting invalid/unused fields to -1. SunOS does
that but our code never has.
o Gets rid of f_type completely. It hasn't been used since NetBSD 0.9
and having it there but always 0 is confusing. It is conceivable
that this may cause some old code to not compile but that is better
than silently breaking.
o Adds a mount_info union that contains the FSTYPE_args struct. This
means that "mount" can now tell you all the options a filesystem was
mounted with. This is especially nice for NFS.
Other changes:
o The linux statfs emulation didn't convert between BSD fs names
and linux f_type numbers. Now it does, since the BSD f_type
number is useless to linux apps (and has been removed anyway)
o FreeBSD's struct statfs is different from our (both old and new)
and thus needs conversion. Previously, the OpenBSD syscalls
were used without any real translation.
o mount(8) will now show extra info when invoked with no arguments.
However, to see *everything* you need to use the -v (verbose) flag.
Diffstat (limited to 'bin/df')
-rw-r--r-- | bin/df/df.c | 6 | ||||
-rw-r--r-- | bin/df/ext2fs_df.c | 1 | ||||
-rw-r--r-- | bin/df/ffs_df.c | 1 | ||||
-rw-r--r-- | bin/df/lfs_df.c | 1 |
4 files changed, 3 insertions, 6 deletions
diff --git a/bin/df/df.c b/bin/df/df.c index e52b2258fa7..bbc150251bc 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: df.c,v 1.23 1999/01/31 18:28:29 millert Exp $ */ +/* $OpenBSD: df.c,v 1.24 1999/05/31 17:34:39 millert Exp $ */ /* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */ /* @@ -49,7 +49,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: df.c,v 1.23 1999/01/31 18:28:29 millert Exp $"; +static char rcsid[] = "$OpenBSD: df.c,v 1.24 1999/05/31 17:34:39 millert Exp $"; #endif #endif /* not lint */ @@ -140,7 +140,7 @@ main(argc, argv) if (!*argv) { mntsize = regetmntinfo(&mntbuf, mntsize); } else { - mntbuf = malloc(argc * sizeof(struct statfs)); + mntbuf = calloc(argc, sizeof(struct statfs)); mntsize = 0; for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { diff --git a/bin/df/ext2fs_df.c b/bin/df/ext2fs_df.c index 623289a7a24..48a30d41380 100644 --- a/bin/df/ext2fs_df.c +++ b/bin/df/ext2fs_df.c @@ -78,7 +78,6 @@ e2fs_df(rfd, file, sfsp) (sblock.e2fs_rev != E2FS_REV)) { return (-1); } - sfsp->f_type = 0; /* Unused field, set to 0 */ sfsp->f_flags = 0; /* The fs is not mapped, so no flags */ sfsp->f_bsize = 1024 << sblock.e2fs_log_bsize; sfsp->f_iosize = 1024 << sblock.e2fs_log_bsize; diff --git a/bin/df/ffs_df.c b/bin/df/ffs_df.c index 412eb6829c6..43bf3e55b8b 100644 --- a/bin/df/ffs_df.c +++ b/bin/df/ffs_df.c @@ -77,7 +77,6 @@ ffs_df(rfd, file, sfsp) if (sblock.fs_magic != FS_MAGIC) { return (-1); } - sfsp->f_type = 0; sfsp->f_flags = 0; sfsp->f_bsize = sblock.fs_fsize; sfsp->f_iosize = sblock.fs_bsize; diff --git a/bin/df/lfs_df.c b/bin/df/lfs_df.c index 3435e28b894..c64b9a2b65b 100644 --- a/bin/df/lfs_df.c +++ b/bin/df/lfs_df.c @@ -75,7 +75,6 @@ lfs_df(rfd, file, sfsp) if (sblock.lfs_magic != LFS_MAGIC) { return (-1); } - sfsp->f_type = 0; /* Unused field, set to 0 */ sfsp->f_flags = 0; /* The fs is not mapped, so no flags */ sfsp->f_bsize = sblock.lfs_bsize; sfsp->f_iosize = sblock.lfs_bsize; |