1 | #ifndef _SYS_STATVFS_H |
---|
2 | #define _SYS_STATVFS_H |
---|
3 | |
---|
4 | #include <sys/cdefs.h> |
---|
5 | #include <sys/types.h> |
---|
6 | |
---|
7 | __BEGIN_DECLS |
---|
8 | |
---|
9 | struct statvfs { |
---|
10 | unsigned long f_bsize; /* file system block size */ |
---|
11 | unsigned long f_frsize; /* fragment size */ |
---|
12 | fsblkcnt_t f_blocks; /* size of fs in f_frsize units */ |
---|
13 | fsblkcnt_t f_bfree; /* # free blocks */ |
---|
14 | fsblkcnt_t f_bavail; /* # free blocks for non-root */ |
---|
15 | fsfilcnt_t f_files; /* # inodes */ |
---|
16 | fsfilcnt_t f_ffree; /* # free inodes */ |
---|
17 | fsfilcnt_t f_favail; /* # free inodes for non-root */ |
---|
18 | unsigned long f_fsid; /* file system ID */ |
---|
19 | unsigned long f_flag; /* mount flags */ |
---|
20 | unsigned long f_namemax; /* maximum filename length */ |
---|
21 | }; |
---|
22 | |
---|
23 | int statvfs(const char *path, struct statvfs *buf) __THROW; |
---|
24 | int fstatvfs(int fd, struct statvfs *buf) __THROW; |
---|
25 | |
---|
26 | /* Definitions for the flag in `f_flag'. These definitions should be |
---|
27 | kept in sync with the definitions in <sys/mount.h>. */ |
---|
28 | enum |
---|
29 | { |
---|
30 | ST_RDONLY = 1, /* Mount read-only. */ |
---|
31 | #define ST_RDONLY ST_RDONLY |
---|
32 | ST_NOSUID = 2 /* Ignore suid and sgid bits. */ |
---|
33 | #define ST_NOSUID ST_NOSUID |
---|
34 | #ifdef __USE_GNU |
---|
35 | , |
---|
36 | ST_NODEV = 4, /* Disallow access to device special files. */ |
---|
37 | # define ST_NODEV ST_NODEV |
---|
38 | ST_NOEXEC = 8, /* Disallow program execution. */ |
---|
39 | # define ST_NOEXEC ST_NOEXEC |
---|
40 | ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ |
---|
41 | # define ST_SYNCHRONOUS ST_SYNCHRONOUS |
---|
42 | ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ |
---|
43 | # define ST_MANDLOCK ST_MANDLOCK |
---|
44 | ST_WRITE = 128, /* Write on file/directory/symlink. */ |
---|
45 | # define ST_WRITE ST_WRITE |
---|
46 | ST_APPEND = 256, /* Append-only file. */ |
---|
47 | # define ST_APPEND ST_APPEND |
---|
48 | ST_IMMUTABLE = 512, /* Immutable file. */ |
---|
49 | # define ST_IMMUTABLE ST_IMMUTABLE |
---|
50 | ST_NOATIME = 1024, /* Do not update access times. */ |
---|
51 | # define ST_NOATIME ST_NOATIME |
---|
52 | ST_NODIRATIME = 2048, /* Do not update directory access times. */ |
---|
53 | # define ST_NODIRATIME ST_NODIRATIME |
---|
54 | ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */ |
---|
55 | # define ST_RELATIME ST_RELATIME |
---|
56 | #endif /* Use GNU. */ |
---|
57 | }; |
---|
58 | |
---|
59 | __END_DECLS |
---|
60 | |
---|
61 | #endif |
---|