vnop_getxacl Entry Point

Purpose

Retrieves the access control list (ACL) for a file. This is an advanced version of vnop_getacl interface.

Syntax

#include <sys/acl.h> 
int vnop_getxacl (vp, ctl_flags, acl_type, uiop, acl_len, mode_info, crp) 

struct vnode   *vp; 
uint64_t       ctl_flags; 
acl_type_t     *acl_type; 
struct uio     *uiop; 
size_t         *acl_len; 
mode_t         *mode_info; 
struct ucred   *crp; 

Description

The vnop_getxacl entry point retrieves the access control list (ACL) for a file system object. It is an advanced version of vnop_getacl interface and provides for ACL-type-based operations. Note that this interface can be used to obtain the ACL type and length information, without actually retrieving the ACL data (see the ctl_flags description for more details).

Parameters

Item Description
vp Specifies the virtual node (v-node) of the file system object.
acl_type Points to buffer space for file systems to return the ACL type associated with the file system object. The value should normally be set to ACL_ANY or 0 when the call is made. Some physical file systems can solicit ACL requests for a particular ACL type. In such cases, the caller provides the ACL type requested in this buffer.
Note: The latter issue is file system implementation specific. For example, when ACL information is requested with an input ACL type, a physical file system might return an error if the existing ACL associated with the file system object is of a different ACL type. Or, the file system might emulate an ACL of the type requested and return.
acl_len Pointer to a length variable. The space pointed to is used as an input, as well as output, parameter. As input, the value will indicate the size of buffer uiop. When the call returns, this space holds the actual length of the ACL (true for when the call is successful or when the call fails with errno set to ENOSPC).
ctl_flags A 64-bit bit mask that provides control over the ACL retrieval and for any future variations in the interface. The following value is defined for these flags:
GET_ACLINFO_ONLY
Gets only the ACL type and length information from the underlying file system. When this bit is set, arguments such as mode_info can be set to NULL. All other cases must be valid buffer pointers or else an error is returned. If this bit is not specified, all the other information about the ACL (such as ACL data and mode information) is returned.
uiop Specifies the uio structure that provides space for the store of the ACL.
mode_info This value indicates any mode word information that needs to be retrieved for the file system object as part of this ACL get operation.
crp Points to the cred structure. This structure contains data that the file system can use to validate access permission.

Execution Environment

The vnop_getxacl entry point can be called from the process environment only.

Return Values

Upon successful completion, the vnop_getxacl entry point returns 0. Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.

Item Description
ENOSPC Indicates that the buffer size specified in the uiop parameter was not large enough to hold the ACL.
Note: This list of error numbers is not complete and is dependent on the particular physical file system implementation supporting the ACL.