aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/statvfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/statvfs.h')
-rw-r--r--sys/sys/statvfs.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/sys/statvfs.h b/sys/sys/statvfs.h
new file mode 100644
index 0000000..7c6492b
--- /dev/null
+++ b/sys/sys/statvfs.h
@@ -0,0 +1,48 @@
+/* $OpenBSD: statvfs.h,v 1.3 2013/03/24 17:45:50 deraadt Exp $ */
+
+/*
+ * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _SYS_STATVFS_H_
+#define _SYS_STATVFS_H_
+
+#include <sys/types.h>
+
+struct statvfs {
+ unsigned long f_bsize; /* file system block size */
+ unsigned long f_frsize; /* fundamental file system block size */
+ fsblkcnt_t f_blocks; /* number of blocks (unit f_frsize) */
+ fsblkcnt_t f_bfree; /* free blocks in file system */
+ fsblkcnt_t f_bavail; /* free blocks for non-root */
+ fsfilcnt_t f_files; /* total file inodes */
+ fsfilcnt_t f_ffree; /* free file inodes */
+ fsfilcnt_t f_favail; /* free file inodes for to non-root */
+ unsigned long f_fsid; /* file system id */
+ unsigned long f_flag; /* bit mask of f_flag values */
+ unsigned long f_namemax; /* maximum filename length */
+};
+
+#define ST_RDONLY 0x0001UL /* read-only filesystem */
+#define ST_NOSUID 0x0002UL /* nosuid flag set */
+
+#ifndef _KERNEL
+__BEGIN_DECLS
+int fstatvfs(int, struct statvfs *);
+int statvfs(const char *, struct statvfs *);
+__END_DECLS
+#endif /* !_KERNEL */
+
+#endif /* !_SYS_STATVFS_H_ */