fstat(2) DG/UX 5.4R3.00 fstat(2)
NAME
fstat - get file status
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
int fstat (fildes, bufferptr)
int fildes;
struct stat * bufferptr;
where:
fildes A valid, active file descriptor
bufferptr Address of a stat buffer to fill
DESCRIPTION
Fstat returns the current attributes of the file referenced by fildes
into the status buffer at the location specified by bufferptr.
The interpretation of the file's attributes depends on the file's
type [see stat(5) for details]. The subject file must be of type
`ordinary-disk-file', `directory', `block-special-file', `character-
special-file', `fifo-special-file' `pipe', or `socket'.
If fstat fails, the contents of the stat buffer are undefined.
ACCESS CONTROL
Read, write, or execute permission of the file is not required.
However, for fildes to be active, the file must be open for reading
or writing.
RETURN VALUE
0 The fstat operation was successful.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
Errno may be set to one of the following error codes:
EBADF fildes is not a valid, active file descriptor.
EFAULT bufferpointer points to an invalid address.
SEE ALSO
chmod(2), chown(2), creat(2), dgmstat(2), fchmod(2), fchown(2),
link(2), lstat(2), mknod(2), pipe(2), read(2), stat(2), time(2),
unlink(2), utime(2), utimes(2), write(2).
Licensed material--property of copyright holder(s) 1