The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

fstatvfs, statvfs - get file system information

 SYNOPSIS



#include <sys/statvfs.h>

int fstatvfs(int fildes, struct statvfs *buf);
int statvfs(const char *path, struct statvfs *buf);

 DESCRIPTION

The fstatvfs() function obtains information about the file system containing the file referenced by fildes.

The following flags can be returned in the f_flag member:

ST_RDONLY
Read-only file system.
ST_NOSUID
Setuid/setgid bits ignored by exec.

The statvfs() function obtains descriptive information about the file system containing the file named by path.

For both functions, the buf argument is a pointer to a statvfs structure that will be filled. Read, write, or execute permission of the named file is not required, but all directories listed in the pathname leading to the file must be searchable.

It is unspecified whether all members of the statvfs structure have meaningful values on all file systems.

 RETURN VALUE

Upon successful completion, statvfs() returns 0. Otherwise, it returns -1 and sets errno to indicate the error.

 ERRORS

The fstatvfs() and statvfs() functions will fail if:
[EIO]
An I/O error occurred while reading the file system.
[EINTR]
A signal was caught during execution of the function.
[EOVERFLOW]
One of the values to be returned cannot be represented correctly in the structure pointed to by buf.

The fstatvfs() function will fail if:

[EBADF]
The fildes argument is not an open file descriptor.

The statvfs() function will fail if:

[EACCES]
Search permission is denied on a component of the path prefix.
[ELOOP]
Too many symbolic links were encountered in resolving path.
[ENAMETOOLONG]
The length of a pathname exceeds {PATH_MAX}, or a pathname component is longer than {NAME_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 path is not a directory.

The statvfs() function may fail if:

[ENAMETOOLONG]
Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

chmod(), chown(), creat(), dup(), exec, fcntl(), link(), mknod(), open(), pipe(), read(), time(), unlink(), utime(), write(), <sys/statvfs.h>.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]