gpfs_getacl_fd() 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_fd(gpfs_file_t fileDesc,
                int flags,
                void *acl);   

Description

The gpfs_getacl_fd() subroutine together with the gpfs_putacl_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.

Note: 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 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 is 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.

The gpfs_opaque_acl_t structure contains size, version, and ACL type information for the gpfs_getacl() and gpfs_putacl() subroutines.

Start of change

Security

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

End of change

Exit status

If the gpfs_getacl_fd() subroutine is successful, it returns a value of 0.

If the gpfs_getacl_fd() 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 list:

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.
ENOTDIR
Start of changeGPFS_ACL_TYPE_DEFAULT is specified as the ACL type and the file is not a directory.End of change
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_fd() subroutine is not supported under the current file system format.

Location

/usr/lpp/mmfs/lib/l ibgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux