Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

fstatvfs1(2) [netbsd man page]

STATVFS(2)						      BSD System Calls Manual							STATVFS(2)

NAME
statvfs, statvfs1, fstatvfs, fstatvfs1 -- get file system statistics LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/statvfs.h> int statvfs(const char *path, struct statvfs *buf); int statvfs1(const char *path, struct statvfs *buf, int flags); int fstatvfs(int fd, struct statvfs *buf); int fstatvfs1(int fd, struct statvfs *buf, int flags); DESCRIPTION
statvfs() and statvfs1() return 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 statvfs structure defined in statvfs(5). fstatvfs() and fstatvfs1() return the same information about an open file referenced by descriptor fd. The statvfs1() and fstatvfs1() functions allow an extra flags argument which can be ST_WAIT and ST_NOWAIT. When ST_NOWAIT is specified, then only cached statistics are returned. This can result in significant savings on non-local filesystems, where gathering statistics involves a network communication. The statvfs() and fstatvfs() calls are equivalent to the respective statvfs1() and fstatvfs1() calls with ST_WAIT specified as the flags argument. RETURN VALUES
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
statvfs() and statvfs1() fail if one or more of the following are true: [ENOTDIR] A component of the path prefix of path is not a directory. [ENAMETOOLONG] The length of a component of path exceeds {NAME_MAX} characters, or the length of path exceeds {PATH_MAX} 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] buf or path points to an invalid address. [EIO] An I/O error occurred while reading from or writing to the file system. fstatvfs() and fstatvfs1() fail if one or more of the following are true: [EBADF] fd is not a valid open file descriptor. [EFAULT] buf points to an invalid address. [EIO] An I/O error occurred while reading from or writing to the file system. SEE ALSO
statvfs(5) HISTORY
The statvfs(), statvfs1(), fstatvfs(), and fstatvfs1() functions first appeared in NetBSD 3.0 to replace the statfs() family of functions which first appeared in 4.4BSD. BSD
April 14, 2004 BSD

Check Out this Related Man Page

STATVFS(3)						   BSD Library Functions Manual 						STATVFS(3)

NAME
fstatvfs, statvfs -- retrieve file system information LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/statvfs.h> int fstatvfs(int fildes, struct statvfs *buf); int statvfs(const char *restrict path, struct statvfs *restrict buf); DESCRIPTION
The statvfs() and fstatvfs() functions attempt to fill the structure pointed to by buf with file system statistics, but portable applications must not depend on this. Applications must pass a pathname or file descriptor which refers to a file on the file system in which they are interested. The statvfs structure contains the following members: f_namemax The maximum length in bytes of a file name on this file system. Applications should use pathconf(2) instead. f_fsid Not meaningful in this implementation. f_frsize The size in bytes of the minimum unit of allocation on this file system. (This corresponds to the f_bsize member of struct statfs.) f_bsize The preferred length of I/O requests for files on this file system. (Corresponds to the f_iosize member of struct statfs.) f_flag Flags describing mount options for this file system; see below. In addition, there are three members of type fsfilcnt_t, which represent counts of file serial numbers (i.e., inodes); these are named f_files, f_favail, and f_ffree, and represent the number of file serial numbers which exist in total, are available to unprivileged pro- cesses, and are available to privileged processes, respectively. Likewise, the members f_blocks, f_bavail, and f_bfree (all of type fsblkcnt_t) represent the respective allocation-block counts. There are two flags defined for the f_flag member: ST_RDONLY The file system is mounted read-only. ST_NOSUID The semantics of the S_ISUID and S_ISGID file mode bits are not supported by, or are disabled on, this file system. IMPLEMENTATION NOTES
The statvfs() and fstatvfs() functions are implemented as wrappers around the statfs() and fstatfs() functions, respectively. Not all the information provided by those functions is made available through this interface. RETURN VALUES
The statvfs() and fstatvfs() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The statvfs() function fails if one or more of the following are true: [EACCES] Search permission is denied for a component of the path prefix of path. [EFAULT] Buf or path points to an invalid address. [EIO] An I/O error occurred while reading from or writing to the file system. [ELOOP] Too many symbolic links were encountered in translating path. [ENAMETOOLONG] The length of a component of path exceeds {NAME_MAX} characters, or the length of path exceeds {PATH_MAX} characters. [ENOENT] The file referred to by path does not exist. [ENOTDIR] A component of the path prefix of Path is not a directory. The fstatvfs() functions fails if one or more of the following are true: [EBADF] fildes is not a valid open file descriptor. [EFAULT] Buf points to an invalid address. [EIO] An I/O error occurred while reading from or writing to the file system. SEE ALSO
statfs(2) STANDARDS
The statvfs() and fstatvfs() functions conform to IEEE Std 1003.1-2001 (``POSIX.1''). As standardized, portable applications cannot depend on these functions returning any valid information at all. This implementation attempts to provide as much useful information as is provided by the underlying file system, subject to the limitations of the specified data types. AUTHORS
The statvfs() and fstatvfs() manual page was originally written by Garrett Wollman <wollman@FreeBSD.org>. BSD
July 13, 2002 BSD
Man Page