gpfs_fstat() subroutine

Returns exact file status for a GPFS file.

Library

GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)

Synopsis

#include <gpfs.h>
int gpfs_fstat(gpfs_file_t fileDesc,
               gpfs_stat64_t *buffer);

Description

The gpfs_fstat() subroutine is used to obtain exact information about the file associated with the fileDesc parameter. This subroutine is provided as an alternative to the stat() subroutine, which may not provide exact mtime and atime values. See Exceptions to Open Group technical standards.

read, write, or execute permission for the named file is not required, but all directories listed in the path leading to the file must be searchable. The file information is written to the area specified by the buffer parameter.

Note: Compile any program that uses this subroutine with the -lgpfs flag from the following library:
  • libgpfs.a for AIX
  • libgpfs.so for Linux

Parameters

fileDesc
The file descriptor identifying the file for which exact status information is requested.
buffer
A pointer to the gpfs_stat64_t structure in which the information is returned. The gpfs_stat64_t structure is described in the sys/stat.h file.

Exit status

If the gpfs_fstat() subroutine is successful, it returns a value of 0.

If the gpfs_fstat() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.

Exceptions

None.

Error status

Error codes include but are not limited to the following:

EBADF
The file descriptor is not valid.
EINVAL
The file descriptor does not refer to a GPFS file or a regular file.
ENOSYS
The gpfs_fstat() subroutine is not supported under the current file system format.
ESTALE
The cached file system information was not valid.

Location

/usr/lpp/mmfs/lib/libgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux