pkg: ship usr/lib/security/amd64/*.so links
[unleashed.git] / include / sys / statvfs.h
blobd4bb49ff83e5031354556e531591d2bd8c4fc068
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
26 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
29 * Use is subject to license terms.
32 #ifndef _SYS_STATVFS_H
33 #define _SYS_STATVFS_H
35 #include <sys/feature_tests.h>
36 #include <sys/types.h>
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 * Structure returned by statvfs(2).
46 #define _FSTYPSZ 16
47 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
48 #ifndef FSTYPSZ
49 #define FSTYPSZ _FSTYPSZ
50 #endif
51 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
53 typedef struct statvfs {
54 unsigned long f_bsize; /* fundamental file system block size */
55 unsigned long f_frsize; /* fragment size */
56 fsblkcnt_t f_blocks; /* total blocks of f_frsize on fs */
57 fsblkcnt_t f_bfree; /* total free blocks of f_frsize */
58 fsblkcnt_t f_bavail; /* free blocks avail to non-superuser */
59 fsfilcnt_t f_files; /* total file nodes (inodes) */
60 fsfilcnt_t f_ffree; /* total free file nodes */
61 fsfilcnt_t f_favail; /* free nodes avail to non-superuser */
62 unsigned long f_fsid; /* file system id (dev for now) */
63 char f_basetype[_FSTYPSZ]; /* target fs type name, */
64 /* null-terminated */
65 unsigned long f_flag; /* bit-mask of flags */
66 unsigned long f_namemax; /* maximum file name length */
67 char f_fstr[32]; /* filesystem-specific string */
68 #if !defined(_LP64)
69 unsigned long f_filler[16]; /* reserved for future expansion */
70 #endif
71 } statvfs_t;
73 #if defined(_SYSCALL32)
75 /* Kernel view of user ILP32 statvfs structure */
77 typedef struct statvfs32 {
78 uint32_t f_bsize; /* fundamental file system block size */
79 uint32_t f_frsize; /* fragment size */
80 fsblkcnt32_t f_blocks; /* total blocks of f_frsize on fs */
81 fsblkcnt32_t f_bfree; /* total free blocks of f_frsize */
82 fsblkcnt32_t f_bavail; /* free blocks avail to non-superuser */
83 fsfilcnt32_t f_files; /* total file nodes (inodes) */
84 fsfilcnt32_t f_ffree; /* total free file nodes */
85 fsfilcnt32_t f_favail; /* free nodes avail to non-superuser */
86 uint32_t f_fsid; /* file system id (dev for now) */
87 char f_basetype[_FSTYPSZ]; /* target fs type name, */
88 /* null-terminated */
89 uint32_t f_flag; /* bit-mask of flags */
90 uint32_t f_namemax; /* maximum file name length */
91 char f_fstr[32]; /* filesystem-specific string */
92 uint32_t f_filler[16]; /* reserved for future expansion */
93 } statvfs32_t;
95 #endif /* _SYSCALL32 */
97 /* transitional large file interface version */
98 typedef struct statvfs64 {
99 unsigned long f_bsize; /* preferred file system block size */
100 unsigned long f_frsize; /* fundamental file system block size */
101 fsblkcnt64_t f_blocks; /* total blocks of f_frsize */
102 fsblkcnt64_t f_bfree; /* total free blocks of f_frsize */
103 fsblkcnt64_t f_bavail; /* free blocks avail to non-superuser */
104 fsfilcnt64_t f_files; /* total # of file nodes (inodes) */
105 fsfilcnt64_t f_ffree; /* total # of free file nodes */
106 fsfilcnt64_t f_favail; /* free nodes avail to non-superuser */
107 unsigned long f_fsid; /* file system id (dev for now) */
108 char f_basetype[_FSTYPSZ]; /* target fs type name, */
109 /* null-terminated */
110 unsigned long f_flag; /* bit-mask of flags */
111 unsigned long f_namemax; /* maximum file name length */
112 char f_fstr[32]; /* filesystem-specific string */
113 #if !defined(_LP64)
114 unsigned long f_filler[16]; /* reserved for future expansion */
115 #endif /* _LP64 */
116 } statvfs64_t;
118 #if defined(_SYSCALL32)
120 /* Kernel view of user ILP32 statvfs64 structure */
122 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
123 #pragma pack(4)
124 #endif
126 typedef struct statvfs64_32 {
127 uint32_t f_bsize; /* preferred file system block size */
128 uint32_t f_frsize; /* fundamental file system block size */
129 fsblkcnt64_t f_blocks; /* total blocks of f_frsize */
130 fsblkcnt64_t f_bfree; /* total free blocks of f_frsize */
131 fsblkcnt64_t f_bavail; /* free blocks avail to non-superuser */
132 fsfilcnt64_t f_files; /* total # of file nodes (inodes) */
133 fsfilcnt64_t f_ffree; /* total # of free file nodes */
134 fsfilcnt64_t f_favail; /* free nodes avail to non-superuser */
135 uint32_t f_fsid; /* file system id (dev for now) */
136 char f_basetype[_FSTYPSZ]; /* target fs type name, */
137 /* null-terminated */
138 uint32_t f_flag; /* bit-mask of flags */
139 uint32_t f_namemax; /* maximum file name length */
140 char f_fstr[32]; /* filesystem-specific string */
141 uint32_t f_filler[16]; /* reserved for future expansion */
142 } statvfs64_32_t;
144 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
145 #pragma pack()
146 #endif
148 #endif /* _SYSCALL32 */
151 * Flag definitions.
154 #define ST_RDONLY 0x01 /* read-only file system */
155 #define ST_NOSUID 0x02 /* does not support setuid/setgid semantics */
156 #define ST_NOTRUNC 0x04 /* does not truncate long file names */
158 #ifndef _KERNEL
159 int statvfs(const char *_RESTRICT_KYWD, struct statvfs *_RESTRICT_KYWD);
160 int fstatvfs(int, struct statvfs *);
163 * FIXME: source compat; statvfs64() is an alias of statvfs(), but the argument
164 * types have different names (struct statvfs vs struct statvfs64) even if
165 * identical, so we can't simply add the function decl here - use a #define
166 * instead.
168 #define statvfs64 statvfs
169 #define statvfs64_t statvfs_t
170 int fstatvfs64(int, struct statvfs *);
171 #endif
173 #ifdef __cplusplus
175 #endif
177 #endif /* _SYS_STATVFS_H */