acl_set_fd()

Set the access ACL for the object associated with a file descriptor

Synopsis:

#include <sys/acl.h>

int acl_set_fd( int fd,
                acl_t acl );

Arguments:

fd
A file descriptor associated with the object whose ACL you want to set.
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_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.

Returns:

0, or -1 if an error occurred (errno is set).

Errors:

EBADF
The fd argument isn't a valid file descriptor.
EINVAL
The acl argument doesn't point to a valid ACL.
ENOSPC
The directory or filesystem that would contain the new ACL can't be extended, or the filesystem is out of file allocation resources.
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:

QNX Neutrino

This function is based on the withdrawn POSIX draft P1003.1e.

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes