1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _SYS_STATVFS_H_
18#define _SYS_STATVFS_H_
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
23
24__BEGIN_DECLS
25
26#ifdef __LP64__
27#define __STATVFS64_RESERVED uint32_t __f_reserved[6];
28#else
29#define __STATVFS64_RESERVED
30#endif
31
32#define __STATVFS64_BODY \
33  unsigned long f_bsize; \
34  unsigned long f_frsize; \
35  fsblkcnt_t    f_blocks; \
36  fsblkcnt_t    f_bfree; \
37  fsblkcnt_t    f_bavail; \
38  fsfilcnt_t    f_files; \
39  fsfilcnt_t    f_ffree; \
40  fsfilcnt_t    f_favail; \
41  unsigned long f_fsid; \
42  unsigned long f_flag; \
43  unsigned long f_namemax; \
44  __STATVFS64_RESERVED
45
46struct statvfs { __STATVFS64_BODY };
47struct statvfs64 { __STATVFS64_BODY };
48
49#undef __STATVFS64_BODY
50#undef __STATVFS64_RESERVED
51
52#define ST_RDONLY      0x0001
53#define ST_NOSUID      0x0002
54#define ST_NODEV       0x0004
55#define ST_NOEXEC      0x0008
56#define ST_SYNCHRONOUS 0x0010
57#define ST_MANDLOCK    0x0040
58#define ST_NOATIME     0x0400
59#define ST_NODIRATIME  0x0800
60#define ST_RELATIME    0x1000
61
62extern int statvfs(const char* __restrict, struct statvfs* __restrict) __nonnull((1, 2));
63extern int statvfs64(const char* __restrict, struct statvfs64* __restrict) __nonnull((1, 2));
64extern int fstatvfs(int, struct statvfs*) __nonnull((2));
65extern int fstatvfs64(int, struct statvfs64*) __nonnull((2));
66
67__END_DECLS
68
69#endif /* _SYS_STATVFS_H_ */
70