Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getmnt(2)

getmountent(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 statfs 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 fs_data structure as defined in getmnt(.).

Return Values

Upon successful completion, a value of 1 is returned. If the file system is not mounted, 0 is returned. Otherwise, −1 is returned and the global variable errno is set to indicate the error. 

Diagnostics

The statfs library routine fails if one or more of the following are true:

[ENOTDIR] A component of the path prefix of path is not a directory. 

[EINVAL] path contains a character with the high-order bit set. 

[ENAMETOOLONG]
The length of a component of path exceeds 255 characters, 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 system. 

See Also

getmnt(2), getmountent(3)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026