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 <zephyr/toolchain.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#if defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__)
29
30/* fsblkcnt_t and fsfilcnt_t are owned by <sys/types.h>; re-declared here as a
31 * shared symbol. newlib and picolibc declare both under _FSBLKCNT_T_DECLARED.
32 */
33#if !defined(_FSBLKCNT_T_DECLARED) && !defined(__fsblkcnt_t_defined)
34typedef unsigned long fsblkcnt_t;
35typedef unsigned long fsfilcnt_t;
36#define _FSBLKCNT_T_DECLARED
37#define _FSFILCNT_T_DECLARED
38#define __fsblkcnt_t_defined
39#define __fsfilcnt_t_defined
40#endif
41
42#if !defined(_STATVFS_DECLARED) && !defined(__statvfs_defined)
47struct statvfs {
48 unsigned long f_bsize;
49 unsigned long f_frsize;
50 fsblkcnt_t f_blocks;
51 fsblkcnt_t f_bfree;
52 fsblkcnt_t f_bavail;
53 fsfilcnt_t f_files;
54 fsfilcnt_t f_ffree;
55 fsfilcnt_t f_favail;
56 unsigned long f_fsid;
57 unsigned long f_flag;
58 unsigned long f_namemax;
59};
60#define _STATVFS_DECLARED
61#define __statvfs_defined
62#endif
63
65#define ST_RDONLY 0x1
67#define ST_NOSUID 0x2
68
77int fstatvfs(int fildes, struct statvfs *buf);
78
87int statvfs(const char *ZRESTRICT path, struct statvfs *ZRESTRICT buf);
88
89#endif /* defined(_POSIX_C_SOURCE) || defined(__DOXYGEN__) */
90
91#ifdef __cplusplus
92}
93#endif
94
95#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:47
unsigned long f_namemax
Maximum filename length.
Definition statvfs.h:58
unsigned long f_fsid
File system ID.
Definition statvfs.h:56
unsigned long f_bsize
File system block size.
Definition statvfs.h:48
fsblkcnt_t f_bavail
Free blocks available to non-privileged processes.
Definition statvfs.h:52
fsfilcnt_t f_files
Total number of file serial numbers.
Definition statvfs.h:53
fsfilcnt_t f_ffree
Total number of free file serial numbers.
Definition statvfs.h:54
fsfilcnt_t f_favail
File serial numbers available to non-privileged processes.
Definition statvfs.h:55
fsblkcnt_t f_blocks
Total blocks on file system, in units of f_frsize.
Definition statvfs.h:50
fsblkcnt_t f_bfree
Total number of free blocks.
Definition statvfs.h:51
unsigned long f_flag
Bit mask of ST_* values.
Definition statvfs.h:57
unsigned long f_frsize
Fundamental file system block size.
Definition statvfs.h:49