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