Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 8
Get filesystem information, given a path
#include <sys/statvfs.h>
int statvfs( const char *path,
struct statvfs *buf );
int statvfs64( const char *path,
struct statvfs64 *buf );
- path
- The name of a file that resides on the filesystem.
- buf
- A pointer to a buffer where the function can store the information.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The statvfs() function returns a “generic superblock”
describing a filesystem; it can be used to acquire information about
mounted filesystems.
The statvfs64() function is a 64-bit version of
statvfs().
The filesystem type is known to the operating system.
You don't need to have read, write, or execute permission for the named file,
but all directories listed in the path name leading
to the file must be searchable.
The buf argument is a pointer to a statvfs or
statvfs64
structure that's filled by the function. It contains at least:
- unsigned long f_bsize
- The preferred filesystem blocksize.
- unsigned long f_frsize
- The fundamental filesystem blocksize (if supported)
- fsblkcnt_t f_blocks
- The total number of blocks on the filesystem, 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 nonsuperuser.
- fsfilcnt_t f_files
- The total number of file nodes (inodes).
- fsfilcnt_t f_ffree
- The total number of free file nodes.
- fsfilcnt_t f_favail
- The number of inodes available to a nonsuperuser.
- unsigned long f_fsid
- The filesystem ID (dev for now).
- char f_basetype[16]
- The type of the target filesystem, as a null-terminated string.
- unsigned long f_flag
- A bitmask of flags; the function can set these flags:
- ST_RDONLY — read-only filesystem.
- ST_NOSUID — the filesystem doesn't support
setuid/setgid semantics.
- unsigned long f_namemax
- The maximum filename length.
- 0
- Success.
- -1
- An error occurred
(errno
is set).
- EACCES
- Search permission is denied on a component of the path prefix.
- EFAULT
- The path or buf argument points to an
illegal address.
- EINTR
- A signal was caught during execution.
- EIO
- An I/O error occurred while reading the filesystem.
- ELOOP
- Too many symbolic links were encountered in translating path.
- EMULTIHOP
- Components of path require hopping to multiple remote machines and
the filesystem type doesn't 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 doesn't exist.
- ENOLINK
- The path argument points to a remote machine and the link
to that machine is no longer active.
- ENOTDIR
- A component of the path prefix of path isn't a directory.
- EOVERFLOW
- One of the values to be returned can't be represented correctly in the
structure pointed to by buf.
statvfs() is
POSIX 1003.1 XSI;
statvfs64() is
Large-file support
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
The values returned for f_files, f_ffree, and
f_favail might not be valid for NFS-mounted filesystems.
chmod(),
chown(),
creat(),
dup(),
fcntl(),
fstatvfs(),
fstatvfs64(),
link(),
mknod(),
open(),
pipe(),
read(),
time(),
unlink(),
utime(),
write()
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 297
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/statvfs.html on line 297