]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/generic/bits/statfs.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / generic / bits / statfs.h
CommitLineData
b168057a 1/* Copyright (C) 2011-2015 Free Software Foundation, Inc.
a63c7fa1
CM
2 This file is part of the GNU C Library.
3 Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
ab84e3ff
PE
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
a63c7fa1
CM
18
19#ifndef _SYS_STATFS_H
20# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
21#endif
22
23#include <endian.h>
24#include <bits/types.h>
25#include <bits/wordsize.h>
26
27/* 64-bit libc uses the kernel's 'struct statfs', accessed via the
28 statfs() syscall; 32-bit libc uses the kernel's 'struct statfs64'
29 and accesses it via the statfs64() syscall. All the various
30 APIs offered by libc use the kernel shape for their struct statfs
31 structure; the only difference is that 32-bit programs not
32 using __USE_FILE_OFFSET64 only see the low 32 bits of some
33 of the fields (the __fsblkcnt_t and __fsfilcnt_t fields). */
34
35#if defined __USE_FILE_OFFSET64
36# define __field64(type, type64, name) type64 name
37#elif __WORDSIZE == 64
38# define __field64(type, type64, name) type name
39#elif __BYTE_ORDER == __LITTLE_ENDIAN
40# define __field64(type, type64, name) \
7cf8ac4c 41 type name __attribute__((__aligned__ (__alignof__ (type64)))); int __##name##_pad
a63c7fa1
CM
42#else
43# define __field64(type, type64, name) \
7cf8ac4c 44 int __##name##_pad __attribute__((__aligned__ (__alignof__ (type64)))); type name
a63c7fa1
CM
45#endif
46
47struct statfs
48 {
49 __SWORD_TYPE f_type;
50 __SWORD_TYPE f_bsize;
51 __field64(__fsblkcnt_t, __fsblkcnt64_t, f_blocks);
52 __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bfree);
53 __field64(__fsblkcnt_t, __fsblkcnt64_t, f_bavail);
54 __field64(__fsfilcnt_t, __fsfilcnt64_t, f_files);
55 __field64(__fsfilcnt_t, __fsfilcnt64_t, f_ffree);
56 __fsid_t f_fsid;
57 __SWORD_TYPE f_namelen;
58 __SWORD_TYPE f_frsize;
59 __SWORD_TYPE f_flags;
60 __SWORD_TYPE f_spare[4];
7cf8ac4c 61 };
a63c7fa1
CM
62
63#undef __field64
64
65#ifdef __USE_LARGEFILE64
66struct statfs64
67 {
68 __SWORD_TYPE f_type;
69 __SWORD_TYPE f_bsize;
70 __fsblkcnt64_t f_blocks;
71 __fsblkcnt64_t f_bfree;
72 __fsblkcnt64_t f_bavail;
73 __fsfilcnt64_t f_files;
74 __fsfilcnt64_t f_ffree;
75 __fsid_t f_fsid;
76 __SWORD_TYPE f_namelen;
77 __SWORD_TYPE f_frsize;
78 __SWORD_TYPE f_flags;
79 __SWORD_TYPE f_spare[4];
7cf8ac4c 80 };
a63c7fa1
CM
81#endif
82
83/* Tell code we have these members. */
84#define _STATFS_F_NAMELEN
85#define _STATFS_F_FRSIZE
86#define _STATFS_F_FLAGS