gpfs_putacl_fd() subroutine
Restores 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_putacl_fd(gpfs_file_t fileDesc,
int flags,
void *acl);
Description
The gpfs_putacl_fd() subroutine together with the gpfs_getacl_fd() subroutine is intended for use by a backup program to save (gpfs_getacl_fd()) and restore (gpfs_putacl_fd()) the ACL information for the file.
- The use of gpfs_fgetattrs() and gpfs_fputattrs() is preferred.
- You must have write access to the file.
- Compile any program that uses this subroutine with the -lgpfs flag
from the following library:
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- fileDesc
- A file descriptor that identifies the file for which the ACLs are to be put.
- 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 is used by backup and restore programs.
- GPFS_PUTACL_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 change 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.
ACL data is stored here and should be the result of a previous invocation of gpfs_getacl().
Exit status
If the gpfs_putacl_fd() subroutine is successful, it returns a value of 0.
If the gpfs_putacl_fd() 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 caller must be the file or directory owner, the root user, or someone with control permission in the ACL, in order for gpfs_putacl_fd() to complete successfully.

Exceptions
None.
Error status
Error codes include but are not limited to the following:
- EINVAL
- The file descriptor does not refer to a GPFS file or a regular file.
- EBADF
- The file descriptor is not valid.
- ENOMEM
- Unable to allocate memory for the request.
- ENOSYS
- The gpfs_putacl_fd() subroutine is not supported under the current file system format.
- ENOTDIR
GPFS_ACL_TYPE_DEFAULT is specified as the ACL type and the file is not a directory.
EPERM
The caller does not hold the appropriate privileges.
EOPNOTSUPP
The file system setting does not allow the provided ACL type.
EAGAIN
Resource temporarily unavailable due to conflicting command running, try again later.
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux