NAME
statvfsdev(), fstatvfsdev() — get file system information
SYNOPSIS
#include <sys/statvfs.h>
int statvfsdev(const char *path, struct statvfs *buf);
int fstatvfsdev(int fildes, struct statvfs *buf);
DESCRIPTION
statvfsdev()
returns information about the file system on the device file specified by
path.
The file system need not be mounted.
fstatvfsdev()
returns similar information for an open file.
The parameters for the
statvfsdev()
and
fstatvfsdev()
functions are as follows:
- path
is a pointer to the name of the device file. (All directories listed in the
path name must be searchable.)
- buf
is a pointer to a
statvfs
structure, which is where the file status information is stored.
- fildes
is a file descriptor for an open file,
which is created with the successful completion of an
open(),
creat(),
dup(),
fcntl(),
or
pipe()
system call (see
open(2),
creat(2),
dup(2),
fcntl(2),
or
pipe(2)).
buf
is a pointer to a
statvfs
structure into which information is placed concerning the file system.
The contents of the structure pointed to by
buf
are described in
statvfs(2).
fstatvfsdev()
returns the same information as above,
but about the open device file referred to by file descriptor
fildes.
RETURN VALUE
Upon successful completion,
statvfsdev()
and
fstatvfsdev()
return zero.
Otherwise, they return -1 and set the global variable
errno
to indicate the error.
ERRORS
If
statvfsdev()
fails,
errno
is set to one of the following values:
- EACCES
Search permission is denied for a component of the path prefix.
- EFAULT
path
points to an invalid address.
- ELOOP
Too many symbolic links are encountered during path-name translation.
- EMFILE
The maximum number of file descriptors allowed are currently open.
- ENAMETOOLONG
The length of the specified path name exceeds
PATH_MAX
bytes, or the length of a component of the path name exceeds
NAME_MAX
bytes while
_POSIX_NO_TRUNC
is in effect.
- ENFILE
The system file table is full.
- ENOENT
The named file does not exist.
- ENOTDIR
A component of the path prefix is not a directory.
- ENXIO
The device specified by the named special file does not exist.
- EOVERFLOW
Result would overflow one or more fields of the
statvfs
struct.
If
fstatvfsdev()
fails,
errno
is set to one of the following values:
- EBADF
fildes
is not a valid open file descriptor.
- ESPIPE
filedes
is invalid.
When both
fstatvfsdev()
and
statvfsdev()
fail,
errno
is set to one of the following values:
- EINTR
A system call was interrupted by a signal.
- EINVAL
The file specified by
path
or
filedes
does not contain a file system of any known type.
- ESOCKETSHUTDOWN
Check with your system administrator to make sure the
fsdaemon
is running properly on your system.
AUTHOR
statvfsdev()
and
fstatvfsdev()
were developed by HP.