gpfs_stat() 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_stat(const char *pathname,
              gpfs_stat64_t *buffer);   

Description

The gpfs_stat() subroutine is used to obtain exact information about the file named by the pathname parameter. This subroutine is provided as an alternative to the stat() subroutine, which may not provide exact mtime and atime values. For more information, 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

pathname
The path 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_stat() subroutine is successful, it returns a value of 0.

If the gpfs_stat() 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:

EINVAL
The path name does not refer to a GPFS file or a regular file.
ENOENT
The file does not exist.
ENOSYS
The gpfs_stat() 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