statfs(3)statfs(3)Name
statfs, - get file system statistics
Syntax
#include <sys/types.h>
#include <sys/param.h>
#include <sys/mount.h>
statfs(path, buffer)
char *path;
struct fs_data *buffer;
Description
The library routine returns up-to-date information about a mounted file
system. The path is the path name of any file within the mounted file
system. The buffer is a pointer to an structure as defined in
Return Values
Upon successful completion, a value of is returned. If the file system
is not mounted, is returned. Otherwise, is returned and the global
variable errno is set to indicate the error.
Diagnostics
The library routine fails if one or more of the following are true:
[ENOTDIR] A component of the path prefix of path is not a direc‐
tory.
[EINVAL] path contains a character with the high-order bit set.
[ENAMETOOLONG] The length of a component of path exceeds 255 charac‐
ters, or the length of path exceeds 1023 characters.
[ENOENT] The file referred to by path does not exist.
[EACCES] Search permission is denied for a component of the path
prefix of path.
[ELOOP] Too many symbolic links were encountered in translating
path.
[EFAULT] buffer or path points to an invalid address.
[EIO] An I/O error occurred while reading from the file sys‐
tem.
See Alsogetmnt(2), getmountent(3)statfs(3)