29.01.2013 Views

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gpfs_stat() Subroutine<br />

Name<br />

gpfs_stat() – Returns exact file status for a <strong>GPFS</strong> file.<br />

Library<br />

<strong>GPFS</strong> Library (libgpfs.a for AIX, libgpfs.so for Linux)<br />

Synopsis<br />

#include <br />

int gpfs_stat(char *pathName, struct stat64 *Buffer)<br />

Description<br />

The gpfs_stat() subroutine is used to obtain exact information about the file named by the pathName<br />

parameter. This subroutine is provided as an alternative to the stat() subroutine, which may not provide<br />

exact mtime <strong>and</strong> atime values. See “Exceptions to Open Group technical st<strong>and</strong>ards” on page 371.<br />

read, write, or execute permission for the named file is not required, but all directories listed in the path<br />

leading to the file must be searchable. The file information is written to the area specified by the Buffer<br />

parameter.<br />

Notes:<br />

1. Compile any program that uses this subroutine with the -lgpfs flag from the following library:<br />

v libgpfs.a for AIX<br />

v libgpfs.so for Linux<br />

Parameters<br />

pathName The path identifying the file for which exact status information is requested.<br />

Buffer A pointer to the stat64 structure in which the information is returned. The stat64 structure<br />

is described in the sys/stat.h file.<br />

Exit status<br />

If the gpfs_stat() subroutine is successful, it returns a value of 0.<br />

If the gpfs_stat() subroutine is unsuccessful, it returns a value of -1 <strong>and</strong> sets the global error variable<br />

errno to indicate the nature of the error.<br />

Exceptions<br />

None.<br />

Error status<br />

EBADF The path name is not valid.<br />

EINVAL The path name does not refer to a <strong>GPFS</strong> file or a regular file.<br />

ENOSYS The gpfs_stat() subroutine is not supported under the current file system format.<br />

Location<br />

/usr/lpp/mmfs/lib/libgpfs.a for AIX, /usr/lpp/mmfs/lib/libgpfs.so for Linux<br />

Chapter 9. <strong>GPFS</strong> programming interfaces 343

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!