µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
statvfs.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ distribution.
3 * (https://github.com/micro-os-plus)
4 * Copyright (c) 2018-2023 Liviu Ionescu. All rights reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software
7 * for any purpose is hereby granted, under the terms of the MIT license.
8 *
9 * If a copy of the license was not distributed with this file, it can
10 * be obtained from https://opensource.org/licenses/mit/.
11 */
12
13#ifndef POSIX_IO_SYS_STATVFS_H_
14#define POSIX_IO_SYS_STATVFS_H_
15
16// ----------------------------------------------------------------------------
17
18#include <unistd.h>
19
20#if defined(_POSIX_VERSION)
21
22#pragma GCC diagnostic push
23#if defined(__clang__)
24#pragma clang diagnostic ignored "-Wgnu-include-next"
25#endif
26#include_next <sys/statvfs.h>
27#pragma GCC diagnostic pop
28
29#else
30
31#include <sys/types.h>
32
33#ifdef __cplusplus
34extern "C"
35{
36#endif
37
38// ----------------------------------------------------------------------------
39
40// Read-only file system.
41#define ST_RDONLY 0x00000001
42
43// Does not support the semantics of the ST_ISUID and ST_ISGID file mode bits.
44#define ST_NOSUID 0x00000002
45
46 struct statvfs
47 {
48 unsigned long f_bsize; // File system block size.
49 unsigned long f_frsize; // Fundamental file system block size.
50 fsblkcnt_t f_blocks; // Total number of blocks on file system in units of f_frsize.
51 fsblkcnt_t f_bfree; // Total number of free blocks.
52 fsblkcnt_t f_bavail; // Number of free blocks available to non-privileged process.
53 fsfilcnt_t f_files; // Total number of file serial numbers.
54 fsfilcnt_t f_ffree; // Total number of free file serial numbers.
55 fsfilcnt_t f_favail; // Number of file serial numbers available to non-privileged process.
56 unsigned long f_fsid; // File system ID.
57 unsigned long f_flag; // Bit mask of f_flag values.
58 unsigned long f_namemax; // Maximum filename length.
59 };
60
61 int
62 fstatvfs (int fildes, struct statvfs *buf);
63
64#pragma GCC diagnostic push
65#if defined(__clang__)
66#elif defined(__GNUC__)
67#pragma GCC diagnostic ignored "-Wshadow"
68#endif
69
70 int
71 statvfs (const char* path, struct statvfs* buf);
72
73// ----------------------------------------------------------------------------
74
75#pragma GCC diagnostic pop
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif /* defined(_POSIX_VERSION) */
82
83#endif /* POSIX_IO_SYS_STATVFS_H_ */
int fstatvfs(int fildes, struct statvfs *buf)
unsigned long f_namemax
Definition statvfs.h:58
unsigned long f_fsid
Definition statvfs.h:56
unsigned long f_bsize
Definition statvfs.h:48
fsblkcnt_t f_bavail
Definition statvfs.h:52
fsfilcnt_t f_files
Definition statvfs.h:53
fsfilcnt_t f_ffree
Definition statvfs.h:54
fsfilcnt_t f_favail
Definition statvfs.h:55
fsblkcnt_t f_blocks
Definition statvfs.h:50
fsblkcnt_t f_bfree
Definition statvfs.h:51
unsigned long f_flag
Definition statvfs.h:57
unsigned long f_frsize
Definition statvfs.h:49