blob: 3495546593addbb21a9bc5aafe2b0e77aae7b8cd [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
Calin Juravle7bec1212014-05-09 22:28:09 +010026#ifdef __LP64__
27#define __STATVFS64_RESERVED uint32_t __f_reserved[6];
28#else
29#define __STATVFS64_RESERVED
30#endif
31
Elliott Hughesdb1ea342014-01-17 18:42:49 -080032#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; \
Calin Juravle7bec1212014-05-09 22:28:09 +010044 __STATVFS64_RESERVED
Elliott Hughesdb1ea342014-01-17 18:42:49 -080045
46struct statvfs { __STATVFS64_BODY };
47struct statvfs64 { __STATVFS64_BODY };
Elliott Hughes06040fd2013-07-09 13:25:03 -070048
Calin Juravle7bec1212014-05-09 22:28:09 +010049#undef __STATVFS64_BODY
50#undef __STATVFS64_RESERVED
51
Elliott Hughes06040fd2013-07-09 13:25:03 -070052#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));
Elliott Hughesdb1ea342014-01-17 18:42:49 -080063extern int statvfs64(const char* __restrict, struct statvfs64* __restrict) __nonnull((1, 2));
Elliott Hughes06040fd2013-07-09 13:25:03 -070064extern int fstatvfs(int, struct statvfs*) __nonnull((2));
Elliott Hughesdb1ea342014-01-17 18:42:49 -080065extern int fstatvfs64(int, struct statvfs64*) __nonnull((2));
Elliott Hughes06040fd2013-07-09 13:25:03 -070066
67__END_DECLS
68
69#endif /* _SYS_STATVFS_H_ */