1 /* $Id: bsd-statvfs.h,v 1.3 2014/01/17 07:48:22 dtucker Exp $ */
4 * Copyright (c) 2008,2014 Darren Tucker <dtucker@zip.com.au>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
15 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
16 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #if !defined(HAVE_STATVFS) || !defined(HAVE_FSTATVFS)
23 #include <sys/types.h>
25 #ifdef HAVE_SYS_MOUNT_H
26 #include <sys/mount.h>
28 #ifdef HAVE_SYS_STATFS_H
29 #include <sys/statfs.h>
32 #ifndef HAVE_FSBLKCNT_T
33 typedef unsigned long fsblkcnt_t
;
35 #ifndef HAVE_FSFILCNT_T
36 typedef unsigned long fsfilcnt_t
;
46 /* as defined in IEEE Std 1003.1, 2004 Edition */
48 unsigned long f_bsize
; /* File system block size. */
49 unsigned long f_frsize
; /* Fundamental file system block size. */
50 fsblkcnt_t f_blocks
; /* Total number of blocks on file system in */
51 /* units of f_frsize. */
52 fsblkcnt_t f_bfree
; /* Total number of free blocks. */
53 fsblkcnt_t f_bavail
; /* Number of free blocks available to */
54 /* non-privileged process. */
55 fsfilcnt_t f_files
; /* Total number of file serial numbers. */
56 fsfilcnt_t f_ffree
; /* Total number of free file serial numbers. */
57 fsfilcnt_t f_favail
; /* Number of file serial numbers available to */
58 /* non-privileged process. */
59 unsigned long f_fsid
; /* File system ID. */
60 unsigned long f_flag
; /* BBit mask of f_flag values. */
61 unsigned long f_namemax
;/* Maximum filename length. */
66 int statvfs(const char *, struct statvfs
*);
70 int fstatvfs(int, struct statvfs
*);