HPlogo HP-UX Reference Volume 4 of 5 > s

statfsdev(3C)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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 on 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:

long f_bavail /* free blocks available to non-superuser */ long f_bfree /* free blocks */ long f_blocks /* total blocks in file system */ long f_bsize /* fundamental file system block size in bytes */ long f_ffree /* free file nodes in file system */ long f_files /* total file nodes in file system */ long 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 */

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.

APPLICATION USAGE

statfsdev() and fstatfsdev() are thread-safe.

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 outstanding 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.

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.

Both fstatfsdev() and statfsdev() fail if one or more of the following is true:

[EAGAIN]

Enforcement-mode record locking was set, and there was a blocking write lock.

[EDEADLK]

A resource deadlock would occur as a result of this operation.

[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.

[ENOLCK]

The system lock table was full, so the read could not go to sleep until the blocking write lock was removed.

AUTHOR

statfsdev() and fstatfsdev() were developed by HP.

FILES

/usr/include/sys/mount.h

© Hewlett-Packard Development Company, L.P.