3eaa2dcf3961425a27e2153995ba3385b037d851
[musl] / include / sys / statvfs.h
1 #ifndef _SYS_STATVFS_H
2 #define _SYS_STATVFS_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #define __NEED_fsblkcnt_t
9 #define __NEED_fsfilcnt_t
10 #include <bits/alltypes.h>
11
12 #include <endian.h>
13
14 struct statvfs {
15         unsigned long f_bsize, f_frsize;
16         fsblkcnt_t f_blocks, f_bfree, f_bavail;
17         fsfilcnt_t f_files, f_ffree, f_favail;
18 #if __BYTE_ORDER == __LITTLE_ENDIAN
19         unsigned long f_fsid;
20         unsigned :8*(2*sizeof(int)-sizeof(long));
21 #else
22         unsigned :8*(2*sizeof(int)-sizeof(long));
23         unsigned long f_fsid;
24 #endif
25         unsigned long f_flag, f_namemax;
26         int __reserved[6];
27 };
28
29 int statvfs (const char *, struct statvfs *);
30 int fstatvfs (int, struct statvfs *);
31
32 #define ST_RDONLY 1
33 #define ST_NOSUID 2
34 #define ST_NODEV  4
35 #define ST_NOEXEC 8
36 #define ST_SYNCHRONOUS 16
37 #define ST_MANDLOCK    64
38 #define ST_WRITE       128
39 #define ST_APPEND      256
40 #define ST_IMMUTABLE   512
41 #define ST_NOATIME     1024
42 #define ST_NODIRATIME  2048
43
44 #ifdef _LARGEFILE64_SOURCE
45 #define statvfs64 statvfs
46 #define fstatvfs64 fstatvfs
47 #define fsblkcnt64_t fsblkcnt_t
48 #define fsfilcnt64_t fsfilcnt_t
49 #endif
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif