gpfs_getacl() subroutine
Retrieves the access control information for a GPFS file.
Library
GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)
Synopsis
#include <gpfs.h>
int gpfs_getacl(const char *pathname,
int flags,
void *acl);
Description
The gpfs_getacl() subroutine, together with the gpfs_putacl() subroutine, is intended for use by a backup program to save (gpfs_getacl()) and restore (gpfs_putacl()) the ACL information for the file.
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- pathname
- The path identifying the file for which the ACLs are being obtained.
- flags
- Consists of one of these values:
- 0
- Indicates that the acl parameter is
to be mapped with the gpfs_opaque_acl_t structure.
The gpfs_opaque_acl_t structure should be used by backup and restore programs.
- GPFS_GETACL_STRUCT
- Indicates that the acl parameter is
to be mapped with the gpfs_acl_t structure.
The gpfs_acl_t structure is provided for applications that need to interpret the ACL.
- acl
- Pointer to a buffer mapped by the structure gpfs_opaque_acl_t or gpfs_acl_t,
depending on the value of flags.
The first four bytes of the buffer must contain its total size.
Exit status
If the gpfs_getacl() subroutine is successful, it returns a value of 0.
If the gpfs_getacl() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.

Security
The gpfs_getacl() subroutine may be invoked by a non-privileged user.

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.
- ENOMEM
- Unable to allocate memory for the request.
- ENOTDIR
GPFS_ACL_TYPE_DEFAULT is specified as the ACL type and pathname is not a directory.
- ENOSPC
- The buffer is too small to return the entire ACL. The required buffer size is returned in the first four bytes of the buffer pointed to by acl.
- ENOSYS
- The gpfs_getacl() 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