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 VALUE

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)

Subroutines

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