Loading...
Searching...
No Matches
statvfs.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016 Eistec AB
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
16/* If building on native we need to use the system libraries instead */
17#ifdef CPU_NATIVE
18#pragma GCC system_header
19/* without the GCC pragma above #include_next will trigger a pedantic error */
20#include_next <sys/statvfs.h>
21#else
22#ifndef SYS_STATVFS_H
23#define SYS_STATVFS_H
24
25#include <sys/types.h> /* for fsblkcnt_t, fsfilcnt_t */
26#if MODULE_NEWLIB
27/* newlib support for fsblkcnt_t was only recently added to the newlib git
28 * repository, commit f3e587d30a9f65d0c6551ad14095300f6e81672e, 15 apr 2016.
29 * Will be included in release 2.5.0, around new year 2016/2017.
30 * We provide the below workaround if the used tool chain is too old. */
31#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
32#include <stdint.h>
33/* Default to 32 bit file sizes on newlib platforms */
34typedef uint32_t fsblkcnt_t;
35typedef uint32_t fsfilcnt_t;
36#define _FSBLKCNT_T_DECLARED
37#endif
38#endif
39#ifdef __cplusplus
40extern "C" {
41#endif
42
46struct statvfs {
47 unsigned long f_bsize;
48 unsigned long f_frsize;
49 fsblkcnt_t f_blocks;
51 fsblkcnt_t f_bfree;
52 fsblkcnt_t f_bavail;
54 fsfilcnt_t f_files;
55 fsfilcnt_t f_ffree;
56 fsfilcnt_t f_favail;
59 unsigned long f_fsid;
60 unsigned long f_flag;
61 unsigned long f_namemax;
62};
63
64enum {
65 ST_RDONLY = 1, /* Mount read-only. */
66 ST_NOSUID = 2, /* Ignore suid and sgid bits. */
67};
68
69#ifdef __cplusplus
70}
71#endif
72
73#endif /* SYS_STATVFS_H */
74
75#endif /* CPU_NATIVE */
76
File system information.
Definition statvfs.h:46
unsigned long f_namemax
Maximum filename length.
Definition statvfs.h:61
unsigned long f_fsid
File system ID.
Definition statvfs.h:59
unsigned long f_bsize
File system block size.
Definition statvfs.h:47
fsblkcnt_t f_bavail
Number of free blocks available to non-privileged process.
Definition statvfs.h:52
fsfilcnt_t f_files
Total number of file serial numbers.
Definition statvfs.h:54
fsfilcnt_t f_ffree
Total number of free file serial numbers.
Definition statvfs.h:55
fsfilcnt_t f_favail
Number of file serial numbers available to non-privileged process.
Definition statvfs.h:56
fsblkcnt_t f_blocks
Total number of blocks on file system in units of f_frsize.
Definition statvfs.h:49
fsblkcnt_t f_bfree
Total number of free blocks.
Definition statvfs.h:51
unsigned long f_flag
Bit mask of f_flag values.
Definition statvfs.h:60
unsigned long f_frsize
Fundamental file system block size.
Definition statvfs.h:48