gpfs_fgetattrs() subroutine
Retrieves all extended file attributes in opaque format.
Library
GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)
Synopsis
#include <gpfs.h>
int gpfs_fgetattrs(gpfs_file_t fileDesc,
int flags,
void *bufferP,
int bufferSize,
int *attrSizeP); Description
The gpfs_fgetattrs() subroutine, together with gpfs_fputattrs(), is intended for use by a backup program to save (gpfs_fgetattrs()) and restore (gpfs_fputattrs()) extended file attributes such as ACLs, DMAPI attributes, and other information for the file. If the file has no extended attributes, the gpfs_fgetattrs() subroutine returns a value of 0, but sets attrSizeP to 0 and leaves the contents of the buffer unchanged.
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- fileDesc
- The file descriptor identifying the file whose extended attributes are being retrieved.
- flags
- Must
have one of the following values:
- GPFS_ATTRFLAG_DEFAULT
- Saves the attributes for file placement and the currently assigned storage pool.
- GPFS_ATTRFLAG_NO_PLACEMENT
- Does not save attributes for file placement or the currently assigned storage pool.
- GPFS_ATTRFLAG_IGNORE_POOL
- Saves attributes for file placement but does not save the currently assigned storage pool.
- GPFS_ATTRFLAG_USE_POLICY
- Uses the restore policy rules to determine the pool ID.
- GPFS_ATTRFLAG_INCL_DMAPI
- Includes the DMAPI attributes.
- GPFS_ATTRFLAG_FINALIZE_ATTRS
- Finalizes immutability attributes.
- GPFS_ATTRFLAG_SKIP_IMMUTABLE
- Skips immutable attributes.
- GPFS_ATTRFLAG_INCL_ENCR
- Includes encryption attributes.
- GPFS_ATTRFLAG_SKIP_CLONE
- Skips clone attributes.
- GPFS_ATTRFLAG_MODIFY_CLONEPARENT
- Allows modification on the clone parent.
- bufferP
- Pointer to a buffer to store the extended attribute information.
- bufferSize
- The size of the buffer that was passed in.
- attrSizeP
- If successful, returns the actual size of the attribute information that was stored in the buffer. If the bufferSize was too small, returns the minimum buffer size.
Exit status
If the gpfs_fgetattrs() subroutine is successful, it returns a value of 0.
If the gpfs_fgetattrs() 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 error codes:
- EBADF
- The file descriptor is not valid.
- EFAULT
- The address is not valid.
- EINVAL
- The file descriptor does not refer to a GPFS file.
- ENOSPC
- bufferSize is too small to return all of the attributes. On return, attrSizeP is set to the required size.
- ENOSYS
- The gpfs_fgetattrs() subroutine is not supported under the current file system format.
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux