Set the access ACL for the object associated with a file descriptor
#include <sys/acl.h> int acl_set_fd( int fd, acl_t acl );
- A file descriptor associated with the object whose ACL you want to set.
- The ACL that you want to assign to the object.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The acl_set_fd() function sets the access ACL for an object associated with a file descriptor. The calling process's effective user ID must match the owner of the directory, or the process must have appropriate privileges in order to set the ACL. The ACL must also be valid, as defined by acl_valid() .
If this function succeeds, the object's file permission bits might change; if it fails, the object's ACL and file permission bits aren't changed.
0, or -1 if an error occurred ( errno is set).
- The fd argument isn't a valid file descriptor.
- The acl argument doesn't point to a valid ACL.
- The directory or filesystem that would contain the new ACL can't be extended, or the filesystem is out of file allocation resources.
- The process doesn't have the appropriate privileges to set the ACL.
- The filesystem that the object is on is currently read-only.
This function is based on the withdrawn POSIX draft P1003.1e.
Last modified: 2013-12-23