acl_set_file()
QNX SDP8.0C Library ReferenceAPIDeveloper
Set the access control list for a path
Synopsis:
#include <sys/acl.h>
int acl_set_file( const char *path_p,
acl_type_t type,
acl_t acl );
Arguments:
- path_p
- The path that you want to set the ACL for.
- type
- The type of ACL; this must currently be ACL_TYPE_ACCESS.
- acl
- The ACL that you want to assign to the object.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The acl_set_file() function sets the access control list for a given path. 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.
Returns:
0, or -1 if an error occurred (errno is set).
Errors:
- EACCES
- Search permission was denied for a component of the path prefix, or the object exists and the process doesn't have the appropriate access rights.
- EINVAL
- The type argument isn't ACL_TYPE_ACCESS.
- ENAMETOOLONG
- The length of the path_p argument exceeds PATH_MAX.
- ENOENT
- The named object doesn't exist, or path_p is an empty string.
- ENOSPC
- The directory or filesystem that would contain the new ACL can't be extended, or the filesystem is out of file allocation resources.
- ENOTDIR
- A component of the path prefix isn't a directory.
- EPERM
- The process doesn't have the appropriate privileges to set the ACL.
- EROFS
- The filesystem that the object is on is currently read-only.
Classification:
This function is based on the withdrawn POSIX draft P1003.1e.
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |
Page updated: