Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ statfs(2) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

df(1M)

stat(2)

ustat(2)

STATFS(2)  —  HP-UX

NAME

statfs, fstatfs − get file system statistics

SYNOPSIS

#include <sys/types.h>
#include <sys/vfs.h>
int statfs(path, buf)
char *path;
struct statfs *buf;

int fstatfs(fildes, buf)
int fildes;
struct statfs *buf;

DESCRIPTION

Statfs returns information about a mounted file system.  Path is the path name of any file within the mounted file system. 

Buf is a pointer to a statfs structure into which information is placed concerning the file system.  The contents of the structure pointed to by buf include the following members:

long f_bavail; /* free blocks available to non-superuser */
long f_bfree; /* free blocks */
long f_blocks; /* total blocks in file system */
long f_bsize; /* fundamental file system block size in bytes */
long f_ffree; /* free file nodes in file system */
long f_files; /* total file nodes in file system */
long f_type; /* type of info, zero for now */
fsid_t f_fsid; /* file system ID */

A file node is a structure in the file system hierarchy that describes a file.  For mounted HP-UX volumes, file node is an HP-UX inode.  For other types of mounts, file node is defined by the system embodying the file pointed to by path. 

Fields that are undefined for a particular file system are set to −1. 

Fstatfs returns the same information about an open file referred to by file descriptor fildes.

RETURN VALUE

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

ERRORS

Statfs fails if one or more of the following is true:

[EACCES] Search permission is denied for a component of the path prefix. 

[EFAULT] Buf or path points to an invalid address. 

[EIO] An I/O error occurs while reading from or writing to the file system. 

[ELOOP] Too many symbolic links are encountered in translating the path name. 

[ENAMETOOLONG]
The path name is too long.

[ENOENT] The named file does not exist. 

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

Fstatfs fails if one or more of the following is true:

[EBADF] Fildes is not a valid open file descriptor. 

[EFAULT] Buf points to an invalid address. 

[EIO] An I/O error occurs while reading from or writing to the file system. 

AUTHOR

Statfs and fstatfs were developed by Sun Microsystems, Inc. 

SEE ALSO

df(1M), stat(2), ustat(2). 

Hewlett-Packard Company  —  May 11, 2021

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