It is unspecified whether all members of the returned struct have meaningful values on all filesystems.
| EBADF || (fstatvfs) fd is not a valid open file descriptor. |
| EACCES || (statvfs) Search permission is denied for a component of the path prefix of path. |
| ELOOP || (statvfs) Too many symbolic links were encountered in translating path. |
| ENAMETOOLONG |
| || (statvfs) path is too long. |
| ENOENT || (statvfs) The file referred to by path does not exist. |
| ENOTDIR |
| || (statvfs) A component of the path prefix of path is not a directory. |
| EFAULT || Buf or path points to an invalid address. |
| EINTR || This call was interrupted by a signal. |
| EIO || An I/O error occurred while reading from the file system. |
| ENOMEM || Insufficient kernel memory was available. |
| ENOSYS || The file system does not support this call. |
| EOVERFLOW |
| || Some values were too large to be represented in the returned struct. |
The Linux kernel has system calls statfs, fstatfs to support this library call.
The current glibc implementation of
uses the f_frsize, f_frsize, and f_bsize fields of the return value of "statvfs(path,buf)".