NAME

zkFstat - get file status

SYNOPSIS

#include "zkSysStat.h"

int zkFstat(int fildes, struct stat *buf);

DESCRIPTION

The zkFstat() function obtains information about an open file associated with the file descriptor fildes, and writes it to the area pointed to by buf.

The buf argument is a pointer to a stat structure, as defined in "zkSysStat.h", into which information is placed concerning the file.

The structure members st_mode, st_uid, st_gid, st_atime, st_ctime and st_mtime will have meaningful values for regular files.

An implementation that provides additional or alternative file access control mechanisms may, under implementation-dependent conditions, cause zkFstat() to fail.

RETURN VALUE

Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error.

ERRORS

The zkFstat() function will fail if:

[EBADF]
The fildes argument is not a valid file descriptor.
[EIO]
An I/O error occurred while reading from the file system.
[EOVERFLOW]
The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf.

The zkFstat() function may fail if:

[EOVERFLOW]
One of the values is too large to store into the structure pointed to by the buf argument.

PORTABILITY

The zkFstat() function may only portably be called on regular files. An implementation may support zkFstat() for other types of files (such as directories or terminals), but such usage is inherently non-portable.

In addition, some implementations may supply meaningful values for structure members st_dev, st_ino, st_nlink, st_uid, st_gid, st_rdev, and st_atime. Again, any such usage is inherently non-portable.