1 | /* Copyright (C) 1997-2024 Free Software Foundation, Inc. |
2 | This file is part of the GNU C Library. |
3 | |
4 | The GNU C Library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Lesser General Public |
6 | License as published by the Free Software Foundation; either |
7 | version 2.1 of the License, or (at your option) any later version. |
8 | |
9 | The GNU C Library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Lesser General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU Lesser General Public |
15 | License along with the GNU C Library; if not, see |
16 | <https://www.gnu.org/licenses/>. */ |
17 | |
18 | #ifndef _SYS_STATVFS_H |
19 | # error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead." |
20 | #endif |
21 | |
22 | #include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */ |
23 | |
24 | #if (__WORDSIZE == 32 \ |
25 | && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) |
26 | #define _STATVFSBUF_F_UNUSED |
27 | #endif |
28 | |
29 | struct statvfs |
30 | { |
31 | unsigned long int f_bsize; |
32 | unsigned long int f_frsize; |
33 | #ifndef __USE_FILE_OFFSET64 |
34 | __fsblkcnt_t f_blocks; |
35 | __fsblkcnt_t f_bfree; |
36 | __fsblkcnt_t f_bavail; |
37 | __fsfilcnt_t f_files; |
38 | __fsfilcnt_t f_ffree; |
39 | __fsfilcnt_t f_favail; |
40 | #else |
41 | __fsblkcnt64_t f_blocks; |
42 | __fsblkcnt64_t f_bfree; |
43 | __fsblkcnt64_t f_bavail; |
44 | __fsfilcnt64_t f_files; |
45 | __fsfilcnt64_t f_ffree; |
46 | __fsfilcnt64_t f_favail; |
47 | #endif |
48 | unsigned long int f_fsid; |
49 | #ifdef _STATVFSBUF_F_UNUSED |
50 | int __f_unused; |
51 | #endif |
52 | unsigned long int f_flag; |
53 | unsigned long int f_namemax; |
54 | unsigned int f_type; |
55 | int __f_spare[5]; |
56 | }; |
57 | |
58 | #ifdef __USE_LARGEFILE64 |
59 | struct statvfs64 |
60 | { |
61 | unsigned long int f_bsize; |
62 | unsigned long int f_frsize; |
63 | __fsblkcnt64_t f_blocks; |
64 | __fsblkcnt64_t f_bfree; |
65 | __fsblkcnt64_t f_bavail; |
66 | __fsfilcnt64_t f_files; |
67 | __fsfilcnt64_t f_ffree; |
68 | __fsfilcnt64_t f_favail; |
69 | unsigned long int f_fsid; |
70 | #ifdef _STATVFSBUF_F_UNUSED |
71 | int __f_unused; |
72 | #endif |
73 | unsigned long int f_flag; |
74 | unsigned long int f_namemax; |
75 | unsigned int f_type; |
76 | int __f_spare[5]; |
77 | }; |
78 | #endif |
79 | |
80 | /* Definitions for the flag in `f_flag'. These definitions should be |
81 | kept in sync with the definitions in <sys/mount.h>. */ |
82 | enum |
83 | { |
84 | ST_RDONLY = 1, /* Mount read-only. */ |
85 | #define ST_RDONLY ST_RDONLY |
86 | ST_NOSUID = 2 /* Ignore suid and sgid bits. */ |
87 | #define ST_NOSUID ST_NOSUID |
88 | #ifdef __USE_GNU |
89 | , |
90 | ST_NODEV = 4, /* Disallow access to device special files. */ |
91 | # define ST_NODEV ST_NODEV |
92 | ST_NOEXEC = 8, /* Disallow program execution. */ |
93 | # define ST_NOEXEC ST_NOEXEC |
94 | ST_SYNCHRONOUS = 16, /* Writes are synced at once. */ |
95 | # define ST_SYNCHRONOUS ST_SYNCHRONOUS |
96 | ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */ |
97 | # define ST_MANDLOCK ST_MANDLOCK |
98 | ST_WRITE = 128, /* Write on file/directory/symlink. */ |
99 | # define ST_WRITE ST_WRITE |
100 | ST_APPEND = 256, /* Append-only file. */ |
101 | # define ST_APPEND ST_APPEND |
102 | ST_IMMUTABLE = 512, /* Immutable file. */ |
103 | # define ST_IMMUTABLE ST_IMMUTABLE |
104 | ST_NOATIME = 1024, /* Do not update access times. */ |
105 | # define ST_NOATIME ST_NOATIME |
106 | ST_NODIRATIME = 2048, /* Do not update directory access times. */ |
107 | # define ST_NODIRATIME ST_NODIRATIME |
108 | ST_RELATIME = 4096, /* Update atime relative to mtime/ctime. */ |
109 | # define ST_RELATIME ST_RELATIME |
110 | ST_NOSYMFOLLOW = 8192 /* Do not follow symlinks. */ |
111 | # define ST_NOSYMFOLLOW ST_NOSYMFOLLOW |
112 | #endif /* Use GNU. */ |
113 | }; |
114 | |