<html>
<head>
<meta name="Content-Style" content="text/css">
</head>
<body>
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="##include <sys/acl.h>">#include <sys/acl.h></a><br>
<a href="#struct acl * acl_get_fd(int fd);">struct acl * acl_get_fd(int fd);</a><br>
<a href="#int acl_set_fd(int fd, struct acl *aclp);">int acl_set_fd(int fd, struct acl *aclp);</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#RETURN VALUES">RETURN VALUES</a><br>
<a href="#ERRORS">ERRORS</a><br>
<!-- Creator : groff version 1.16.1 -->
<!-- CreationDate: Wed Jan 24 01:42:48 2001
-->
<!-- Total number of pages: 1 -->
<!-- Page: 1 -->
<!-- left margin: 220 -->
<!-- right margin: 750 -->
<a name="NAME"></a><h2>NAME</h2><p style="margin-left: 18%"><font size=3>acl_get_fd, acl_set_fd - get or set the ACL associated with an open file</font></p>
<a name="SYNOPSIS"></a><h2>SYNOPSIS</h2><a name="#include <sys/acl.h>"></a><h2>#include <sys/acl.h></h2><a name="struct acl * acl_get_fd(int fd);"></a><h2>struct acl * acl_get_fd(int fd);</h2><a name="int acl_set_fd(int fd, struct acl *aclp);"></a><h2>int acl_set_fd(int fd, struct acl *aclp);</h2><a name="DESCRIPTION"></a><h2>DESCRIPTION</h2><p style="margin-left: 18%"><font size=3><I>acl_get_fd</I></font> <font size=3>returns a pointer to an allocated</font> <font size=3><I>struct acl</I></font> <font size=3>associated with the open file referred to by</font> <font size=3><I>fd</I></font><font size=3>. If</font> <font size=3><B>_POSIX_MAC</B></font> <font size=3>is in effect, then the process must have MAC read access to the object.</font></p>
<p style="margin-left: 18%"><font size=3><I>acl_set_fd</I></font> <font size=3>sets the ACL for the open file referred to by</font> <font size=3><I>fd</I></font> <font size=3>from the</font> <font size=3><I>struct acl</I></font> <font size=3>pointed to by</font> <font size=3><I>aclp</I></font><font size=3>. The effective UID of the process must match the owner of the object or the process must have appropriate privilege to set the access ACL on the object. If</font> <font size=3><B>_POSIX_CAP</B></font> <font size=3>is in effect, then the appropriate capability must include CAP_FOWNER. In addition, if</font> <font size=3><B>_POSIX_MAC</B></font> <font size=3>is in effect, then the process must have MAC write access to the object.</font> <font size=3><I>acl_set_fd</I></font> <font size=3>function will succeed only if the ACL is valid as defined by the</font> <font size=3><I>acl_valid</I></font><font size=3>(3) function.</font></p>
<a name="RETURN VALUES"></a><h2>RETURN VALUES</h2><p style="margin-left: 18%"><font size=3><I>acl_get_fd</I></font> <font size=3>returns a pointer to an allocated</font> <font size=3><I>struct acl</I></font> <font size=3>if successful, NULL otherwise. The storage should be freed with a call to</font> <font size=3><I>acl_free</I></font> <font size=3>with the returned pointer as an argument when it is no longer needed.</font></p>
<p style="margin-left: 18%"><font size=3><I>acl_set_fd</I></font> <font size=3>returns 0 if successful, ­1 otherwise.</font></p>
<a name="ERRORS"></a><h2>ERRORS</h2>
<table width="98%" rules="none" frame="none" cols="4" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="10%">
<p><font size=3><I>acl_get_fd:</I></font></p>
</td>
<td valign="top" align="left" width="4%">
</td>
<td valign="top" align="left" width="66%">
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="10%">
<p><font size=3>EACCESS EBADF</font></p>
<p><font size=3>ENOMEM ENOSYS</font></p>
<p><font size=3><I>acl_set_fd:</I></font></p>
</td>
<td valign="top" align="left" width="4%">
</td>
<td valign="top" align="left" width="66%">
<p><font size=3>Access to the object is denied.</font></p>
<p><font size=3><I>fd</I></font> <font size=3>is not a valid file descriptor.</font></p>
<p><font size=3>allocation of the</font> <font size=3><I>struct acl</I></font> <font size=3>failed.</font></p>
<p><font size=3>ACL support is not available (not installed).</font></p>
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="10%">
<p><font size=3>EACCESS EBADF</font></p>
<p><font size=3>EINVAL</font></p>
<p><font size=3>ENOSPC</font></p>
</td>
<td valign="top" align="left" width="4%">
</td>
<td valign="top" align="left" width="66%">
<p><font size=3>Access to the object is denied.</font></p>
<p><font size=3><I>fd</I></font> <font size=3>is not a valid file descriptor.</font></p>
<p><font size=3>The ACL is not valid or too large (too many entries).</font></p>
<p><font size=3>The file system is full or some other resource needed for the ACL storage is not available.</font></p>
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="10%">
<p><font size=3>ENOSYS EPERM</font></p>
</td>
<td valign="top" align="left" width="4%">
</td>
<td valign="top" align="left" width="66%">
<p><font size=3>ACL support is not available (not installed).</font></p>
<p><font size=3>The process does not have appropriate privilege to perform the operation to set the ACL.</font></p>
</td>
</tr>
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="10%">
<p><font size=3>EROFS</font></p>
</td>
<td valign="top" align="left" width="4%">
</td>
<td valign="top" align="left" width="66%">
<p><font size=3>This function requires modification of a file system which is currently read­only.</font></p>
</td>
</tr>
</table>
</body>
</html>