Retrieves the AIXC ACL type access control information for a file.
Standard C Library (libc.a)
#include <sys/acl.h>
#include <sys/stat.h>
int statacl (Path, Command, ACL, ACLSize)
char * Path;
int Command;
struct acl * ACL;
int ACLSize;
int fstatacl (FileDescriptor, Command, ACL, ACLSize)
int FileDescriptor;
int Command;
struct acl *ACL;
int ACLSize;
The statacl and fstatacl subroutines return the access control information for a file system object if the ACL associated is of AIXC type. If the ACL associated is of different type or if the underlying physical file system does not support AIXC ACL type, error could be returned by these interfaces. If the statacl subroutine is used on NFS V4 files, invalid results are returned.
Item | Description |
---|---|
Path | Specifies a pointer to the path name of a file. |
FileDescriptor | Specifies the file descriptor of an open file. |
Command | Specifies the mode of the path interpretation for Path,
specifically whether to retrieve information about a symbolic link
or mount point. Valid values for the Command parameter are
defined in the stat.h file and include:
|
ACL | Specifies a pointer to a buffer to contain the AIXC-type
Access Control List (ACL) of the file system object. The format of
an AIXC ACL is defined in the sys/acl.h file and includes the
following members:
The members for the base ACL (owner, group, and others) may contain the following bits, which are defined in the sys/access.h file:
|
ACLSize | Specifies the size of the buffer to contain the ACL. If this value is too small, the first word of the ACL is set to the size of the buffer needed. |
On successful completion, the statacl and fstatacl subroutines return a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The statacl subroutine fails if one or more of the following are true:
Item | Description |
---|---|
ENOTDIR | A component of the Path prefix is not a directory. |
ENOENT | A component of the Path does not exist or has the disallow truncation attribute (see the ulimit subroutine). |
ENOENT | The Path parameter was null. |
EACCES | Search permission is denied on a component of the Path prefix. |
EFAULT | The Path parameter points to a location outside of the allocated address space of the process. |
ESTALE | The process' root or current directory is located in a virtual file system that has been unmounted. |
ELOOP | Too many symbolic links were encountered in translating the Path parameter. |
ENOENT | A symbolic link was named, but the file to which it refers does not exist. |
ENAMETOOLONG | A component of the Path parameter exceeded 255 characters, or the entire Path parameter exceeded 1023 characters. |
The fstatacl subroutine fails if the following is true:
Item | Description |
---|---|
EBADF | The file descriptor FileDescriptor is not valid. |
The statacl or fstatacl subroutine fails if one or more of the following are true:
Item | Description |
---|---|
EFAULT | The ACL parameter points to a location outside of the allocated address space of the process. |
EINVAL | The Command parameter is not a value of STX_LINK, STX_MOUNT, STX_NORMAL. |
ENOSPC | The ACLSize parameter indicates the buffer at ACL is too small to hold the Access Control List. In this case, the first word of the buffer is set to the size of the buffer required. |
EIO | An I/O error occurred during the operation. |
If Network File System (NFS) is installed on your system, the statacl and fstatacl subroutines can also fail if the following is true:
Item | Description |
---|---|
ETIMEDOUT | The connection timed out. |