canonical / canonical/stdlibc.dart
I didn't find the function statvfs(const char *path, struct statvfs *buf);
- Dominant language
- Dart
- Stars
- 58
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
I didn't find the function statvfs(const char *path, struct statvfs *buf);
I want to use this function to know how much space is free on a drive partition
```c
NAME
statvfs, fstatvfs - get file system statistics
SYNOPSIS
#include
int statvfs(const char *path, struct statvfs *buf);
int fstatvfs(int fd, struct statvfs *buf);
DESCRIPTION
The function statvfs() returns information about a mounted file system.
path is the pathname of any file within the mounted file system. buf
is a pointer to a statvfs structure defined approximately as follows:
struct statvfs {
unsigned long f_bsize; /* file system block size */
unsigned long f_frsize; /* fragment size */
fsblkcnt_t f_blocks; /* size of fs in f_frsize units */
fsblkcnt_t f_bfree; /* # free blocks */
fsblkcnt_t f_bavail; /* # free blocks for unprivileged users */
fsfilcnt_t f_files; /* # inodes */
fsfilcnt_t f_ffree; /* # free inodes */
fsfilcnt_t f_favail; /* # free inodes for unprivileged users */
unsigned long f_fsid; /* file system ID */
unsigned long f_flag; /* mount flags */
unsigned long f_namemax; /* maximum filename length */
};
```
https://docs.rs/libc/latest/libc/struct.statvfs.html
https://github.com/lattera/freebsd/blob/master/lib/libc/gen/statvfs.c
https://github.com/lattera/glibc/blob/master/bits/statvfs.h
https://man7.org/linux/man-pages/man3/statvfs.3.html
Contributor guide
Assessment
This issue has not been assessed yet.