Gets the access control information of a file.
Security Library (libc.a)
#include <sys/access.h>
char *acl_get (Path)
char * Path;
char *acl_fget (FileDescriptor)
int FileDescriptor;
The acl_get and acl_fget subroutines retrieve the access control information for a file system object. This information is returned in a buffer pointed to by the return value. The structure of the data in this buffer is unspecified. The value returned by these subroutines should be used only as an argument to the acl_put or acl_fput subroutines to copy or restore the access control information.
The buffer returned by the acl_get and acl_fget subroutines is in allocated memory. After usage, the caller should deallocate the buffer using the free subroutine.
Path | Specifies the path name of the file. |
FileDescriptor | Specifies the file descriptor of an open file. |
On successful completion, the acl_get and acl_fget subroutines return a pointer to the buffer containing the access control information. Otherwise, a null pointer is returned and the errno global variable is set to indicate the error.
The acl_get subroutine fails if one or more of the following are true:
The acl_fget subroutine fails if the following is true:
EBADF | The FileDescriptor parameter is not a valid file descriptor. |
The acl_get or acl_fget subroutine fails if the following is true:
EIO | An I/O error occurred during the operation. |
If Network File System (NFS) is installed on your system, the acl_get and acl_fget subroutines can also fail if the following is true:
ETIMEDOUT | The connection timed out. |
Access Control | The invoker must have search permission for all components of the Path prefix. |
Audit Events | None. |
The acl_chg or acl_fchg (acl_chg or acl_fchg Subroutine) subroutine, acl_put or acl_fput (acl_put or acl_fput Subroutine) subroutine, acl_set or acl_fset (acl_set or acl_fset Subroutine) subroutine, chacl (chacl or fchacl Subroutine) subroutine, chmod (chmod or fchmod Subroutine) subroutine, stat subroutine, statacl subroutine.
The aclget command, aclput command, chmod command.
List of Security and Auditing Subroutines and Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.