DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

statvfs(S)


statvfs, statvfs64, fstatvfs, fstatvfs64 -- get file system information

Synopsis

   #include <sys/types.h>
   #include <sys/statvfs.h>
   

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

int statvfs64(const char *path, struct statvfs64 *buf);

int fstatvfs(int fildes, struct statvfs *buf);

int fstatvfs64(int fildes, struct statvfs64 *buf);

Description

statvfs returns a ``generic superblock'' describing a filesystem; it can be used to acquire information about mounted filesystems. buf is a pointer to a structure (described below) that is filled by the system call.

path should name a file that resides on that file system. The file system type is known to the operating system. Read, write, or execute permission for the named file is not required, but all directories listed in the pathname leading to the file must be searchable.

For details on the statvfs and statvfs64 structures pointed to by buf see statvfs(M).

fstatvfs is similar to statvfs, except that the file named by path in statvfs is instead identified by an open file descriptor fildes obtained from a successful open, creat, dup, fcntl, or pipe system call.

Return values

On success, statvfs, statvfs64, fstatvfs, and fstatvfs64 return 0. On failure, they return -1 and set errno to identify the error.

In the following conditions, statvfs and statvfs64 fail and set errno to:


EACCES
Search permission is denied on a component of the path prefix.

EFAULT
path or buf points outside the process's allocated address space.

EINTR
A signal was caught during statvfs or statvfs64 execution.

EIO
An I/O error occurred while reading the file system.

ELOOP
Too many symbolic links were encountered in translating path.

EMULTIHOP
Components of path require hopping to multiple remote machines and file system type does not allow it.

ENAMETOOLONG
The length of a path component exceeds {NAME_MAX} characters, or the length of path exceeds {PATH_MAX} characters.

ENOENT
Either a component of the path prefix or the file referred to by path does not exist.

ENOLINK
path points to a remote machine and the link to that machine is no longer active.

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

In the following conditions, fstatvfs, and fstatvfs64 fail and set errno to:


EFAULT
buf points to an invalid address.

EBADF
fildes is not an open file descriptor.

EINTR
A signal was caught during fstatvfs or fstatvfs64 execution.

EIO
An I/O error occurred while reading the file system.

References

chmod(S), chown(S), creat(S), intro(S), link(S), mknod(S), pipe(S), read(S), statvfs(M), time(S), unlink(S), utime(S), write(S)

Notices

Considerations for large file support

statvfs64 and fstatvfs64 support large files, but are otherwise identical to statvfs and fstatvfs, respectively. For details on programming for large file capable applications, see ``Large File Support'' on intro(S).
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005