STATFS(2) — HP-UX
Series 300 Only
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.
NETWORKING FEATURES
NFS
The f_fsid value is used for exported file system security by NFS.
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
Hewlett-Packard Company — Version B.1, May 11, 2021