1/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
17
18#ifndef _SYS_STATVFS_H
19# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
20#endif
21
22#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
23
24#if (__WORDSIZE == 32 \
25 && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32))
26#define _STATVFSBUF_F_UNUSED
27#endif
28
29struct statvfs
30 {
31 unsigned long int f_bsize;
32 unsigned long int f_frsize;
33#ifndef __USE_FILE_OFFSET64
34 __fsblkcnt_t f_blocks;
35 __fsblkcnt_t f_bfree;
36 __fsblkcnt_t f_bavail;
37 __fsfilcnt_t f_files;
38 __fsfilcnt_t f_ffree;
39 __fsfilcnt_t f_favail;
40#else
41 __fsblkcnt64_t f_blocks;
42 __fsblkcnt64_t f_bfree;
43 __fsblkcnt64_t f_bavail;
44 __fsfilcnt64_t f_files;
45 __fsfilcnt64_t f_ffree;
46 __fsfilcnt64_t f_favail;
47#endif
48 unsigned long int f_fsid;
49#ifdef _STATVFSBUF_F_UNUSED
50 int __f_unused;
51#endif
52 unsigned long int f_flag;
53 unsigned long int f_namemax;
54 int __f_spare[6];
55 };
56
57#ifdef __USE_LARGEFILE64
58struct statvfs64
59 {
60 unsigned long int f_bsize;
61 unsigned long int f_frsize;
62 __fsblkcnt64_t f_blocks;
63 __fsblkcnt64_t f_bfree;
64 __fsblkcnt64_t f_bavail;
65 __fsfilcnt64_t f_files;
66 __fsfilcnt64_t f_ffree;
67 __fsfilcnt64_t f_favail;
68 unsigned long int f_fsid;
69#ifdef _STATVFSBUF_F_UNUSED
70 int __f_unused;
71#endif
72 unsigned long int f_flag;
73 unsigned long int f_namemax;
74 int __f_spare[6];
75 };
76#endif
77
78/* Definitions for the flag in `f_flag'. These definitions should be
79 kept in sync with the definitions in <sys/mount.h>. */
80enum
81{
82 ST_RDONLY = 1, /* Mount read-only. */
83#define ST_RDONLY ST_RDONLY
84 ST_NOSUID = 2 /* Ignore suid and sgid bits. */
85#define ST_NOSUID ST_NOSUID
86#ifdef __USE_GNU
87 ,
88 ST_NODEV = 4, /* Disallow access to device special files. */
89# define ST_NODEV ST_NODEV
90 ST_NOEXEC = 8, /* Disallow program execution. */
91# define ST_NOEXEC ST_NOEXEC
92 ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
93# define ST_SYNCHRONOUS ST_SYNCHRONOUS
94 ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
95# define ST_MANDLOCK ST_MANDLOCK
96 ST_WRITE = 128, /* Write on file/directory/symlink. */
97# define ST_WRITE ST_WRITE
98 ST_APPEND = 256, /* Append-only file. */
99# define ST_APPEND ST_APPEND
100 ST_IMMUTABLE = 512, /* Immutable file. */
101# define ST_IMMUTABLE ST_IMMUTABLE
102 ST_NOATIME = 1024, /* Do not update access times. */
103# define ST_NOATIME ST_NOATIME
104 ST_NODIRATIME = 2048, /* Do not update directory access times. */
105# define ST_NODIRATIME ST_NODIRATIME
106 ST_RELATIME = 4096 /* Update atime relative to mtime/ctime. */
107# define ST_RELATIME ST_RELATIME
108#endif /* Use GNU. */
109};
110