Name
gpfs_fcntl - Passes hints and directives to GPFS on behalf of an open file.
Library
GPFS Library (libgpfs.a)
Synopsis
#include <gpfs_fcntl.h> int gpfs_fcntl(int fileDesc, void* fcntlArgP)
Description
This function passes hint and directives to GPFS on behalf of an open file, while obtaining the necessary size, version, and error information from the gpfsFcntlHeader_t structure (see Communicating file access patterns to GPFS):
Notes:
Parameters
Exit status
If the gpfs_fcntl( ) subroutine is successful, it returns a value of 0.
If the gpfs_fcntl( ) 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
The hint or directive is invalid.
Examples
The following piece of code will release all cache data held by the file handle and tell GPFS that the file will write the portion of the file with file offsets between 2G and 3G-1:
struct
{
gpfsFcntlHeader_t hdr;
gpfsClearFileCache_t rel;
gpfsAccessRange_t acc;
} arg;
arg.hdr.totalLength = sizeof(arg);
arg.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
arg.hdr.fcntlReserved = 0;
arg.rel.structLen = sizeof(arg.rel);
arg.rel.structType = GPFS_CLEAR_FILE_CACHE;
arg.acc.structLen = sizeof(arg.acc);
arg.acc.structType = GPFS_ACCESS_RANGE;
arg.acc.start = 2LL * 1024LL * 1024LL * 1024LL;
arg.acc.length = 1024 * 1024 * 1024;
arg.acc.isWrite = 1;
rc = gpfs_fcntl(handle, &arg);
Location
/usr/lpp/mmfs/lib/libgpfs.a