posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
statvfs.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
19#ifndef ZEPHYR_INCLUDE_POSIX_SYS_STATVFS_H_
20#define ZEPHYR_INCLUDE_POSIX_SYS_STATVFS_H_
21
22#include <stdint.h>
23
24#include <zephyr/toolchain.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#if defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__)
31
32/* fsblkcnt_t and fsfilcnt_t are owned by <sys/types.h>; re-declared here as a
33 * shared symbol. newlib and picolibc declare both under _FSBLKCNT_T_DECLARED.
34 */
35#if !defined(_FSBLKCNT_T_DECLARED) && !defined(__fsblkcnt_t_defined)
36typedef uint64_t fsblkcnt_t;
37typedef uint32_t fsfilcnt_t;
38#define _FSBLKCNT_T_DECLARED
39#define _FSFILCNT_T_DECLARED
40#define __fsblkcnt_t_defined
41#define __fsfilcnt_t_defined
42#endif
43
44#if !defined(_STATVFS_DECLARED) && !defined(__statvfs_defined)
49struct statvfs {
50 unsigned long f_bsize;
51 unsigned long f_frsize;
52 fsblkcnt_t f_blocks;
53 fsblkcnt_t f_bfree;
54 fsblkcnt_t f_bavail;
55 fsfilcnt_t f_files;
56 fsfilcnt_t f_ffree;
57 fsfilcnt_t f_favail;
58 unsigned long f_fsid;
59 unsigned long f_flag;
60 unsigned long f_namemax;
61};
62#define _STATVFS_DECLARED
63#define __statvfs_defined
64#endif
65
67#define ST_RDONLY 0x1
69#define ST_NOSUID 0x2
70
79int fstatvfs(int fildes, struct statvfs *buf);
80
89int statvfs(const char *ZRESTRICT path, struct statvfs *ZRESTRICT buf);
90
91#endif /* defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__) */
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* ZEPHYR_INCLUDE_POSIX_SYS_STATVFS_H_ */
int fstatvfs(int fildes, struct statvfs *buf)
Get file system information for the file system containing an open file.
File system information returned by statvfs() and fstatvfs().
Definition statvfs.h:49
unsigned long f_namemax
Maximum filename length.
Definition statvfs.h:60
unsigned long f_fsid
File system ID.
Definition statvfs.h:58
unsigned long f_bsize
File system block size.
Definition statvfs.h:50
fsblkcnt_t f_bavail
Free blocks available to non-privileged processes.
Definition statvfs.h:54
fsfilcnt_t f_files
Total number of file serial numbers.
Definition statvfs.h:55
fsfilcnt_t f_ffree
Total number of free file serial numbers.
Definition statvfs.h:56
fsfilcnt_t f_favail
File serial numbers available to non-privileged processes.
Definition statvfs.h:57
fsblkcnt_t f_blocks
Total blocks on file system, in units of f_frsize.
Definition statvfs.h:52
fsblkcnt_t f_bfree
Total number of free blocks.
Definition statvfs.h:53
unsigned long f_flag
Bit mask of ST_* values.
Definition statvfs.h:59
unsigned long f_frsize
Fundamental file system block size.
Definition statvfs.h:51