HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
s
statvfs(2) statvfs(2)
NAME
statvfs, fstatvfs - get file system information
SYNOPSIS
#include <sys/types.h>
#include <sys/statvfs.h>
int statvfs (const char *path, struct statvfs *buf);
int fstatvfs (int fildes, struct statvfs *buf);
DESCRIPTION
statvfs() returns information about a mounted file system.
fstatvfs() returns similar information about an open file.
The parameters for the statvfs() and fstatvfs() functions are as follows:
path is a pointer to a path name of any file within the mounted file system.
buf is a pointer to a statvfs structure, which is where the file system status
information is stored.
fildes is a file descriptor for an open file, which is created with the successful comple-
tion of an
open(), creat(), dup(), fcntl(),orpipe() system call (see
open(2), creat(2), dup(2), fcntl(2), or pipe(2)).
The
statvfs structure contains the following members:
ulong f_bsize; /* preferred file system block size */
ulong f_frsize; /* fundamental file system block size */
ulong f_blocks; /* total blocks of f_frsize on file system */
ulong f_size; /* size of file system in f_frsize unit */
ulong f_bfree; /* free blocks */
ulong f_bavail; /* blocks available to non-superuser */
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in file system */
long f_favail; /* file nodes available to non-superuser */
long f_fsid; /* file system ID for file system */
/* type; see sysfs(2) */
char f_basetype[FSTYPSZ]; /* file system type name is null-terminated */
long f_flag; /* bit mask of flags */
long f_namemax /* maximum file name length */
char f_fstr[32]; /* file system specific string */
time_t f_time; /* Last time file system was written */
The field f_basetype contains a null-terminated file-system-type name.
The constant [FSTYPSZ] is defined in the header file <statvfs.h> .
The following flags can be returned in the f_flag field:
ST_LARGEFILES File system is enabled for large files.
ST_RDONLY File system is read-only.
ST_NOSUID File system does not support setuid and setgid semantics.
ST_EXPORTED File system is exported (NFS).
ST_QUOTA Quotas are enabled on this file system.
RETURN VALUE
statvfs() and fstatvfs() return 0 upon successful completion; otherwise, they return 1 and set
errno to indicate the error.
ERRORS
If statvfs() fails, errno is set to one of the following values:
[EACCES] Search permission is denied for a component of the path prefix.
Section 2384 1 HP-UX Release 11i: December 2000
___
___