HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)

s
statfsdev(3C) statfsdev(3C)
NAME
statfsdev, fstatfsdev - get file system statistics
SYNOPSIS
#include <sys/vfs.h>
int statfsdev(const char *path, struct statfs *buf);
int fstatfsdev(int fildes, struct statfs *buf);
DESCRIPTION
statfsdev() returns information about the file system contained in the file specified by path.
buf is a pointer to a
statfs structure into which information is placed concerning the file system. The
contents of the structure pointed to by buf include the following members:
int32_t f_bavail /* free blocks available to non-superuser */
int32_t f_bfree /* free blocks */
int32_t f_blocks /* total blocks in file system */
int32_t f_bsize /* fundamental file system block size in bytes */
int32_t f_ffree /* free file nodes in file system */
int32_t f_files /* total file nodes in file system */
int32_t f_type /* type of info, zero for now */
fsid_t f_fsid /* file system ID. f_fsid[1] is MOUNT_UFS,
MOUNT_NFS, or MOUNT_CDFS */
The fields f_blocks, f_bavail, and f_bfree are expressed in terms of blocks of size
f_bsize.
Fields that are undefined for a particular file system are set to 1.
fstatfsdev() returns the same information as above, but about the open file referred to by file
descriptor fildes.
RETURN VALUE
Upon successful completion,
statfsdev() and fstatfsdev() return zero. Otherwise, they return
1 and set the global variable errno to indicate the error.
ERRORS
statfsdev() fails if one or more of the following conditions are encountered:
[EACCES] Search permission is denied for a component of the path prefix.
[EAGAIN] The file exists, enforcement mode file/record locking is set, and there are outstand-
ing record locks on the file.
[EFAULT] path points to an invalid address.
[ELOOP] Too many symbolic links are encountered in translating the path name.
[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
statfs struct.
fstatfsdev() fails if one or more of the following is true:
[EBADF] fildes is not a valid open file descriptor.
[ESPIPE] filedes points to an invalid address.
Section 31004 Hewlett-Packard Company 1 HP-UX 11i Version 2: September 2004