Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/statvfs.h
+++ new/usr/src/uts/common/sys/statvfs.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 23 /* All Rights Reserved */
24 24
25 -
26 25 /*
26 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
27 + *
27 28 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 29 * Use is subject to license terms.
29 30 */
30 31
31 32 #ifndef _SYS_STATVFS_H
32 33 #define _SYS_STATVFS_H
33 34
34 -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.10 */
35 -
36 35 #include <sys/feature_tests.h>
37 36 #include <sys/types.h>
38 37
39 38 #ifdef __cplusplus
40 39 extern "C" {
41 40 #endif
42 41
43 42 /*
44 43 * Structure returned by statvfs(2).
45 44 */
46 45
47 46 #define _FSTYPSZ 16
48 47 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
49 48 #ifndef FSTYPSZ
50 49 #define FSTYPSZ _FSTYPSZ
51 50 #endif
52 51 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
53 52
54 53 typedef struct statvfs {
55 54 unsigned long f_bsize; /* fundamental file system block size */
56 55 unsigned long f_frsize; /* fragment size */
57 56 fsblkcnt_t f_blocks; /* total blocks of f_frsize on fs */
58 57 fsblkcnt_t f_bfree; /* total free blocks of f_frsize */
59 58 fsblkcnt_t f_bavail; /* free blocks avail to non-superuser */
60 59 fsfilcnt_t f_files; /* total file nodes (inodes) */
61 60 fsfilcnt_t f_ffree; /* total free file nodes */
62 61 fsfilcnt_t f_favail; /* free nodes avail to non-superuser */
63 62 unsigned long f_fsid; /* file system id (dev for now) */
64 63 char f_basetype[_FSTYPSZ]; /* target fs type name, */
65 64 /* null-terminated */
66 65 unsigned long f_flag; /* bit-mask of flags */
67 66 unsigned long f_namemax; /* maximum file name length */
68 67 char f_fstr[32]; /* filesystem-specific string */
69 68 #if !defined(_LP64)
70 69 unsigned long f_filler[16]; /* reserved for future expansion */
71 70 #endif
72 71 } statvfs_t;
73 72
74 73 #if defined(_SYSCALL32)
75 74
76 75 /* Kernel view of user ILP32 statvfs structure */
77 76
78 77 typedef struct statvfs32 {
79 78 uint32_t f_bsize; /* fundamental file system block size */
80 79 uint32_t f_frsize; /* fragment size */
81 80 fsblkcnt32_t f_blocks; /* total blocks of f_frsize on fs */
82 81 fsblkcnt32_t f_bfree; /* total free blocks of f_frsize */
83 82 fsblkcnt32_t f_bavail; /* free blocks avail to non-superuser */
84 83 fsfilcnt32_t f_files; /* total file nodes (inodes) */
85 84 fsfilcnt32_t f_ffree; /* total free file nodes */
86 85 fsfilcnt32_t f_favail; /* free nodes avail to non-superuser */
87 86 uint32_t f_fsid; /* file system id (dev for now) */
88 87 char f_basetype[_FSTYPSZ]; /* target fs type name, */
89 88 /* null-terminated */
90 89 uint32_t f_flag; /* bit-mask of flags */
91 90 uint32_t f_namemax; /* maximum file name length */
92 91 char f_fstr[32]; /* filesystem-specific string */
93 92 uint32_t f_filler[16]; /* reserved for future expansion */
94 93 } statvfs32_t;
95 94
96 95 #endif /* _SYSCALL32 */
97 96
98 97 /* transitional large file interface version */
99 98 #if defined(_LARGEFILE64_SOURCE)
100 99 typedef struct statvfs64 {
101 100 unsigned long f_bsize; /* preferred file system block size */
102 101 unsigned long f_frsize; /* fundamental file system block size */
103 102 fsblkcnt64_t f_blocks; /* total blocks of f_frsize */
104 103 fsblkcnt64_t f_bfree; /* total free blocks of f_frsize */
105 104 fsblkcnt64_t f_bavail; /* free blocks avail to non-superuser */
106 105 fsfilcnt64_t f_files; /* total # of file nodes (inodes) */
107 106 fsfilcnt64_t f_ffree; /* total # of free file nodes */
108 107 fsfilcnt64_t f_favail; /* free nodes avail to non-superuser */
109 108 unsigned long f_fsid; /* file system id (dev for now) */
110 109 char f_basetype[FSTYPSZ]; /* target fs type name, */
111 110 /* null-terminated */
112 111 unsigned long f_flag; /* bit-mask of flags */
113 112 unsigned long f_namemax; /* maximum file name length */
114 113 char f_fstr[32]; /* filesystem-specific string */
115 114 #if !defined(_LP64)
116 115 unsigned long f_filler[16]; /* reserved for future expansion */
117 116 #endif /* _LP64 */
118 117 } statvfs64_t;
119 118 #endif
120 119
121 120 #if defined(_SYSCALL32)
122 121
123 122 /* Kernel view of user ILP32 statvfs64 structure */
124 123
125 124 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
126 125 #pragma pack(4)
127 126 #endif
128 127
129 128 typedef struct statvfs64_32 {
130 129 uint32_t f_bsize; /* preferred file system block size */
131 130 uint32_t f_frsize; /* fundamental file system block size */
132 131 fsblkcnt64_t f_blocks; /* total blocks of f_frsize */
133 132 fsblkcnt64_t f_bfree; /* total free blocks of f_frsize */
134 133 fsblkcnt64_t f_bavail; /* free blocks avail to non-superuser */
135 134 fsfilcnt64_t f_files; /* total # of file nodes (inodes) */
136 135 fsfilcnt64_t f_ffree; /* total # of free file nodes */
137 136 fsfilcnt64_t f_favail; /* free nodes avail to non-superuser */
138 137 uint32_t f_fsid; /* file system id (dev for now) */
139 138 char f_basetype[FSTYPSZ]; /* target fs type name, */
140 139 /* null-terminated */
141 140 uint32_t f_flag; /* bit-mask of flags */
142 141 uint32_t f_namemax; /* maximum file name length */
143 142 char f_fstr[32]; /* filesystem-specific string */
144 143 uint32_t f_filler[16]; /* reserved for future expansion */
145 144 } statvfs64_32_t;
146 145
147 146 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
148 147 #pragma pack()
149 148 #endif
150 149
151 150 #endif /* _SYSCALL32 */
152 151
153 152 /*
154 153 * Flag definitions.
155 154 */
156 155
157 156 #define ST_RDONLY 0x01 /* read-only file system */
158 157 #define ST_NOSUID 0x02 /* does not support setuid/setgid semantics */
159 158 #define ST_NOTRUNC 0x04 /* does not truncate long file names */
160 159
161 160 #if !defined(_KERNEL)
162 161 /*
163 162 * large file compilation environment setup
164 163 */
165 164 #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
166 165 #ifdef __PRAGMA_REDEFINE_EXTNAME
167 166 #pragma redefine_extname statvfs statvfs64
168 167 #pragma redefine_extname fstatvfs fstatvfs64
169 168 #else
170 169 #define statvfs_t statvfs64_t
171 170 #define statvfs statvfs64
172 171 #define fstatvfs fstatvfs64
173 172 #endif
174 173 #endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
175 174
176 175 #if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
177 176 /*
178 177 * In the LP64 compilation environment, map large file interfaces
179 178 * back to native versions where possible.
180 179 */
↓ open down ↓ |
135 lines elided |
↑ open up ↑ |
181 180 #ifdef __PRAGMA_REDEFINE_EXTNAME
182 181 #pragma redefine_extname statvfs64 statvfs
183 182 #pragma redefine_extname fstatvfs64 fstatvfs
184 183 #else
185 184 #define statvfs64_t statvfs_t
186 185 #define statvfs64 statvfs
187 186 #define fstatvfs64 fstatvfs
188 187 #endif
189 188 #endif /* _LP64 && _LARGEFILE64_SOURCE */
190 189
191 -#if defined(__STDC__)
192 190 int statvfs(const char *_RESTRICT_KYWD, statvfs_t *_RESTRICT_KYWD);
193 191 int fstatvfs(int, statvfs_t *);
194 192
195 193 /* transitional large file interface versions */
196 194 #if defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
197 195 !defined(__PRAGMA_REDEFINE_EXTNAME))
198 196 int statvfs64(const char *_RESTRICT_KYWD, statvfs64_t *_RESTRICT_KYWD);
199 197 int fstatvfs64(int, statvfs64_t *);
200 198 #endif /* _LARGEFILE64_SOURCE... */
201 -#endif /* defined(__STDC__) */
202 199 #endif /* !defined(_KERNEL) */
203 200
204 201 #ifdef __cplusplus
205 202 }
206 203 #endif
207 204
208 205 #endif /* _SYS_STATVFS_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX