Debian Codegraph @

share/libc/sys/statvfs.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_SYS_STATVFS_H__
24 #define __FC_SYS_STATVFS_H__
25
26 #include "../features.h"
27 __PUSH_FC_STDLIB
28 __BEGIN_DECLS
29
30 #include "../__fc_define_fs_cnt.h"
31
32 struct statvfs {
33 unsigned long f_bsize; // File system block size.
34 unsigned long f_frsize; // Fundamental file system block size.
35 fsblkcnt_t f_blocks; // Total number of blocks on file system in units of
36 // f_frsize.
37 fsblkcnt_t f_bfree; // Total number of free blocks.
38 fsblkcnt_t f_bavail; // Number of free blocks available to
39 // non-privileged process.
40 fsfilcnt_t f_files; // Total number of file serial numbers.
41 fsfilcnt_t f_ffree; // Total number of free file serial numbers.
42 fsfilcnt_t f_favail; // Number of file serial numbers available to
43 // non-privileged process.
44 unsigned long f_fsid; // File system ID.
45 unsigned long f_flag; // Bit mask of f_flag values.
46 unsigned long f_namemax; // Maximum filename length.
47 };
48
49 extern int fstatvfs(int fildes, struct statvfs *buf);
50
51 extern int statvfs(const char *restrict path, struct statvfs *restrict buf);
52
53 __END_DECLS
54 __POP_FC_STDLIB
55 #endif