1 /* Copyright (C) 1997,1998,2000,2001,2002,2006 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    <http://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 #define _STATVFSBUF_F_UNUSED
26 #endif
27 
28 struct statvfs
29   {
30     unsigned long int f_bsize;
31     unsigned long int f_frsize;
32 #ifndef __USE_FILE_OFFSET64
33     __fsblkcnt_t f_blocks;
34     __fsblkcnt_t f_bfree;
35     __fsblkcnt_t f_bavail;
36     __fsfilcnt_t f_files;
37     __fsfilcnt_t f_ffree;
38     __fsfilcnt_t f_favail;
39 #else
40     __fsblkcnt64_t f_blocks;
41     __fsblkcnt64_t f_bfree;
42     __fsblkcnt64_t f_bavail;
43     __fsfilcnt64_t f_files;
44     __fsfilcnt64_t f_ffree;
45     __fsfilcnt64_t f_favail;
46 #endif
47     unsigned long int f_fsid;
48 #ifdef _STATVFSBUF_F_UNUSED
49     int __f_unused;
50 #endif
51     unsigned long int f_flag;
52     unsigned long int f_namemax;
53     int __f_spare[6];
54   };
55 
56 #ifdef __USE_LARGEFILE64
57 struct statvfs64
58   {
59     unsigned long int f_bsize;
60     unsigned long int f_frsize;
61     __fsblkcnt64_t f_blocks;
62     __fsblkcnt64_t f_bfree;
63     __fsblkcnt64_t f_bavail;
64     __fsfilcnt64_t f_files;
65     __fsfilcnt64_t f_ffree;
66     __fsfilcnt64_t f_favail;
67     unsigned long int f_fsid;
68 #ifdef _STATVFSBUF_F_UNUSED
69     int __f_unused;
70 #endif
71     unsigned long int f_flag;
72     unsigned long int f_namemax;
73     int __f_spare[6];
74   };
75 #endif
76 
77 /* Definitions for the flag in `f_flag'.  These definitions should be
78    kept in sync with the definitions in <sys/mount.h>.  */
79 enum
80 {
81   ST_RDONLY = 1,		/* Mount read-only.  */
82 #define ST_RDONLY	ST_RDONLY
83   ST_NOSUID = 2			/* Ignore suid and sgid bits.  */
84 #define ST_NOSUID	ST_NOSUID
85 #ifdef __USE_GNU
86   ,
87   ST_NODEV = 4,			/* Disallow access to device special files.  */
88 # define ST_NODEV	ST_NODEV
89   ST_NOEXEC = 8,		/* Disallow program execution.  */
90 # define ST_NOEXEC	ST_NOEXEC
91   ST_SYNCHRONOUS = 16,		/* Writes are synced at once.  */
92 # define ST_SYNCHRONOUS	ST_SYNCHRONOUS
93   ST_MANDLOCK = 64,		/* Allow mandatory locks on an FS.  */
94 # define ST_MANDLOCK	ST_MANDLOCK
95   ST_WRITE = 128,		/* Write on file/directory/symlink.  */
96 # define ST_WRITE	ST_WRITE
97   ST_APPEND = 256,		/* Append-only file.  */
98 # define ST_APPEND	ST_APPEND
99   ST_IMMUTABLE = 512,		/* Immutable file.  */
100 # define ST_IMMUTABLE	ST_IMMUTABLE
101   ST_NOATIME = 1024,		/* Do not update access times.  */
102 # define ST_NOATIME	ST_NOATIME
103   ST_NODIRATIME = 2048,		/* Do not update directory access times.  */
104 # define ST_NODIRATIME	ST_NODIRATIME
105   ST_RELATIME = 4096		/* Update atime relative to mtime/ctime.  */
106 # define ST_RELATIME	ST_RELATIME
107 #endif	/* Use GNU.  */
108 };
109