summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-05-31 17:34:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-05-31 17:34:56 +0000
commitbc8362e4ef1c185f7c1d9aec69d91f269c97d4e2 (patch)
tree9194d1773b772347d76766611948ee38e1002058 /lib/libc
parent7a1b6dcd69cb5defd76dca41d6f8252a3140fb91 (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 'lib/libc')
-rw-r--r--lib/libc/shlib_version4
-rw-r--r--lib/libc/sys/getfsstat.241
-rw-r--r--lib/libc/sys/statfs.239
3 files changed, 41 insertions, 43 deletions
diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version
index deb0e308e38..629f8a9fc41 100644
--- a/lib/libc/shlib_version
+++ b/lib/libc/shlib_version
@@ -1,2 +1,2 @@
-major=21
-minor=2
+major=22
+minor=0
diff --git a/lib/libc/sys/getfsstat.2 b/lib/libc/sys/getfsstat.2
index 055f313de14..7a483aa995b 100644
--- a/lib/libc/sys/getfsstat.2
+++ b/lib/libc/sys/getfsstat.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: getfsstat.2,v 1.7 1999/02/27 21:56:18 deraadt Exp $
+.\" $OpenBSD: getfsstat.2,v 1.8 1999/05/31 17:34:41 millert Exp $
.\" $NetBSD: getfsstat.2,v 1.6 1995/06/29 11:40:44 cgd Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
@@ -45,7 +45,7 @@
.Fd #include <sys/ucred.h>
.Fd #include <sys/mount.h>
.Ft int
-.Fn getfsstat "struct statfs *buf" "long bufsize" "int flags"
+.Fn getfsstat "struct statfs *buf" "size_t bufsize" "int flags"
.Sh DESCRIPTION
.Fn getfsstat
returns information about all mounted file systems.
@@ -56,31 +56,30 @@ structures defined as follows:
.Bd -literal
typedef struct { int32_t val[2]; } fsid_t;
-#define MFSNAMELEN 16 /* length of fs type name, including nul */
+#define MFSNAMELEN 16 /* length of fs type name, including NUL */
#define MNAMELEN 32 /* length of buffer for returned name */
struct statfs {
- short f_type; /* type of file system (unused; zero) */
- short f_flags; /* copy of mount flags */
- 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 */
- long f_syncwrites; /* count of sync writes since mount */
- long f_asyncwrites; /* count of async writes since mount */
- 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 */
+ u_int32_t f_flags; /* copy of mount flags */
+ u_int32_t f_bsize; /* fundamental file system block size */
+ u_int32_t f_iosize; /* optimal transfer block size */
+ u_int32_t f_blocks; /* total data blocks in file system */
+ u_int32_t f_bfree; /* free blocks in fs */
+ u_int32_t f_bavail; /* free blocks avail to non-superuser */
+ u_int32_t f_files; /* total file nodes in file system */
+ u_int32_t f_ffree; /* free file nodes in fs */
+ fsid_t f_fsid; /* file system id */
+ uid_t f_owner; /* user that mounted the file system */
+ u_int32_t f_syncwrites; /* count of sync writes since mount */
+ u_int32_t f_asyncwrites; /* count of async writes since mount */
+ u_int32_t f_spare[4]; /* 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 */
+ union mount_info mount_info; /* per-filesystem mount options */
};
.Ed
.Pp
-Fields that are undefined for a particular file system are set to -1.
The buffer is filled with an array of
.Fa statfs
structures, one for each mounted file system
diff --git a/lib/libc/sys/statfs.2 b/lib/libc/sys/statfs.2
index c48361f1cbe..3b80f94e48b 100644
--- a/lib/libc/sys/statfs.2
+++ b/lib/libc/sys/statfs.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: statfs.2,v 1.9 1999/04/18 17:26:52 espie Exp $
+.\" $OpenBSD: statfs.2,v 1.10 1999/05/31 17:34:41 millert Exp $
.\" $NetBSD: statfs.2,v 1.10 1995/06/29 11:40:48 cgd Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
@@ -59,31 +59,30 @@ structure defined as follows:
.Bd -literal
typedef struct { int32_t val[2]; } fsid_t;
-#define MFSNAMELEN 16 /* length of fs type name, including nul */
+#define MFSNAMELEN 16 /* length of fs type name, including NUL */
#define MNAMELEN 32 /* length of buffer for returned name */
struct statfs {
- short f_type; /* type of file system (unused; zero) */
- short f_flags; /* copy of mount flags */
- 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 (super-user only) */
- uid_t f_owner; /* user that mounted the file system */
- long f_syncwrites; /* count of sync writes since mount */
- long f_asyncwrites; /* count of async writes since mount */
- 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 */
+ u_int32_t f_flags; /* copy of mount flags */
+ u_int32_t f_bsize; /* fundamental file system block size */
+ u_int32_t f_iosize; /* optimal transfer block size */
+ u_int32_t f_blocks; /* total data blocks in file system */
+ u_int32_t f_bfree; /* free blocks in fs */
+ u_int32_t f_bavail; /* free blocks avail to non-superuser */
+ u_int32_t f_files; /* total file nodes in file system */
+ u_int32_t f_ffree; /* free file nodes in fs */
+ fsid_t f_fsid; /* file system id */
+ uid_t f_owner; /* user that mounted the file system */
+ u_int32_t f_syncwrites; /* count of sync writes since mount */
+ u_int32_t f_asyncwrites; /* count of async writes since mount */
+ u_int32_t f_spare[4]; /* 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 */
+ union mount_info mount_info; /* per-filesystem mount options */
};
.Ed
.Pp
-Fields that are undefined for a particular file system are set to -1.
.Fn fstatfs
returns the same information about an open file referenced by descriptor
.Fa fd .