blob: 3d8179eb8cc69f29742fc04d8cb3199ac1ea9e46 [file] [log] [blame]
Elliott Hughes06040fd2013-07-09 13:25:03 -07001/*
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
Elliott Hughesdb1ea342014-01-17 18:42:49 -080026#define __STATVFS64_BODY \
27 unsigned long f_bsize; \
28 unsigned long f_frsize; \
29 fsblkcnt_t f_blocks; \
30 fsblkcnt_t f_bfree; \
31 fsblkcnt_t f_bavail; \
32 fsfilcnt_t f_files; \
33 fsfilcnt_t f_ffree; \
34 fsfilcnt_t f_favail; \
35 unsigned long f_fsid; \
36 unsigned long f_flag; \
37 unsigned long f_namemax; \
38
39struct statvfs { __STATVFS64_BODY };
40struct statvfs64 { __STATVFS64_BODY };
Elliott Hughes06040fd2013-07-09 13:25:03 -070041
42#define ST_RDONLY 0x0001
43#define ST_NOSUID 0x0002
44#define ST_NODEV 0x0004
45#define ST_NOEXEC 0x0008
46#define ST_SYNCHRONOUS 0x0010
47#define ST_MANDLOCK 0x0040
48#define ST_NOATIME 0x0400
49#define ST_NODIRATIME 0x0800
50#define ST_RELATIME 0x1000
51
52extern int statvfs(const char* __restrict, struct statvfs* __restrict) __nonnull((1, 2));
Elliott Hughesdb1ea342014-01-17 18:42:49 -080053extern int statvfs64(const char* __restrict, struct statvfs64* __restrict) __nonnull((1, 2));
Elliott Hughes06040fd2013-07-09 13:25:03 -070054extern int fstatvfs(int, struct statvfs*) __nonnull((2));
Elliott Hughesdb1ea342014-01-17 18:42:49 -080055extern int fstatvfs64(int, struct statvfs64*) __nonnull((2));
Elliott Hughes06040fd2013-07-09 13:25:03 -070056
57__END_DECLS
58
59#endif /* _SYS_STATVFS_H_ */