 |
Index for Section 2 |
|
 |
Alphabetical listing for S |
|
 |
Bottom of page |
|
statvfs(2)
NAME
statvfs, fstatvfs - Get file system information
SYNOPSIS
#include <sys/statvfs.h>
int statvfs
const char *path,
struct statvfs *buffer );
int fstatvfs
int file_descriptor,
struct statvfs *buffer );
STANDARDS
Interfaces documented on this reference page conform to industry standards
as follows:
fstatvfs(), statvfs(): POSIX.1, XSH4.2, XSH5.0
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
PARAMETERS
path Specifies any file within the mounted file system.
fildes Specifies a file descriptor obtained by a successful open() or
fcntl() function.
buffer Points to a statvfs buffer to hold the returned information for the
statvfs() or fstatvfs() function. See DESCRIPTION for the contents
of the statvfs structure.
DESCRIPTION
The statvfs() and fstatvfs() functions return descriptive information about
a mounted file system. The returned information is in the format of a
statvfs structure, which is defined in the <sys/statvfs.h> header file and
contains the following members:
unsigned long f_bsize
The file system block size.
unsigned long f_frsize
The fundamental file system block size.
fsblkcnt_t f_blocks
The total number of blocks in the file system in units of f_frsize.
fsblkcnt_t f_bfree
The total number of free blocks.
fsblkcnt_t f_bavail
The number of free blocks available to a non-privileged process. (Not
applicable to AdvFS.)
fsfilcnt_t f_files
The total number of file serial numbers (for example, inodes).
fsfilcnt_t f_ffree
The total number of free file serial numbers. (For UFS and AdvFS,
f_ffree and f_favail are synonymous.)
fsfilcnt_t f_favail
The number of file serial numbers available to a non-privileged
process. (For UFS and AdvFS, f_ffree and f_favail are synonymous.)
unsigned long f_fsid
The file system identifier.
unsigned long f_flag
A bit mask representing one or more of the followng flags:
ST_RONLY
The file system is read only.
ST_NOSUID
The file system does not support setuid/setgid semantics.
unsigned long f_namemax
The maximum length of a file name.
RETURN VALUES
Upon successful completion, either function returns 0 (zero). Otherwise, it
returns -1 and sets errno to indicate the error.
ERRORS
If the statvfs() function fails, errno may be set to one of the following
values:
[EACCES]
Search permission is denied for a component of the path prefix.
[EFAULT]
[Tru64 UNIX] The requested address is invalid.
[EIO] An I/O error occurred while reading the file system.
[EINTR] A signal was caught during execution of the function.
[EINVAL]
[Tru64 UNIX] One of the values returned to the statvfs structure
is invalid. This can happen when the file system is mounted through
NFS and the NFS server returns an error to an NFS client call that
was indirectly invoked through statvfs().
[ELOOP] Too many symbolic links were encountered in translating the path
parameter detected.
[ENAMETOOLONG]
The length of a component of the path parameter exceeds NAME_MAX,
or the length of the path parameter exceeds PATH_MAX.
Pathname resolution of a symbolic link produced an intermediate
result whose length exceeds PATH_MAX.
[ENOENT]
A component of path does not name an existing file or path is an
empty string.
[ENOTDIR]
A component of the path prefix of the path parameter is not a
directory.
If the fstatvfs() function fails, errno may be set to the following values:
[EBADF] The file descriptor parameter contains an invalid value.
[EFAULT]
[Tru64 UNIX] The requested address is invalid.
[EINTR] A signal was caught during execution of the function.
[EINVAL]
[Tru64 UNIX] One of the values returned to the fstatvfs structure
is invalid. This can happen when the file system is mounted through
NFS and the NFS server returns an error to an NFS client call that
was indirectly invoked through statvfs().
[EIO] For AdvFS, the target file system belongs to an AdvFS domain that,
after the file descriptor was opened, became inaccessible because
of a domain panic.
SEE ALSO
Functions: stat(2), statfs(2)
Standards: standards(5)
 |
Index for Section 2 |
|
 |
Alphabetical listing for S |
|
 |
Top of page |
|