[BACK]Return to attr_set.html CVS log [TXT][DIR] Up to [Development] / xfs-website.orig / manpages

File: [Development] / xfs-website.orig / manpages / attr_set.html (download) (as text)

Revision 1.2, Thu Jan 25 19:55:30 2001 UTC (16 years, 8 months ago) by xfs
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +132 -96 lines

Man pages update.

<html>
<head>
<meta name="Content-Style" content="text/css">
</head>
<body>
<a href="#NAME">NAME</a><br>
<a href="#C SYNOPSIS">C SYNOPSIS</a><br>
<a href="##include &lt;sys/attributes.h&gt;">#include &lt;sys/attributes.h&gt;</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
<a href="#SEE ALSO">SEE ALSO</a><br>
<a href="#DIAGNOSTICS">DIAGNOSTICS</a><br>
<!-- Creator     : groff version 1.16.1  -->
<!-- CreationDate: Wed Jan 24 01:42:50 2001
 -->
<!-- Total number of pages: 2 -->
<!-- Page: 1 -->
<!-- left  margin: 220 -->
<!-- right margin: 750 -->
<a name="NAME"></a><h2>NAME</h2><p style="margin-left: 18%"><font size=3>attr_set, attr_setf - set the value of a user attribute of a filesystem object</font></p>
<a name="C SYNOPSIS"></a><h2>C SYNOPSIS</h2><a name="#include &lt;sys/attributes.h&gt;"></a><h2>#include &lt;sys/attributes.h&gt;</h2><p style="margin-left: 18%"><font size=3><B>int attr_set (const char</B></font> <font size=3>*</font><font size=3><B>path, const char</B></font> <font size=3>*</font><font size=3><B>attrname,</B></font>
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="24%">
</p>
</td>
<td valign="top" align="left" width="75%">
<p><font size=3><B>const char</B></font> <font size=3>*</font><font size=3><B>attrvalue, const int valuelength,</B></font></p>
</td>
</tr>
</table>

<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="24%">
</p>
</td>
<td valign="top" align="left" width="75%">
<p><font size=3><B>int flags);</B></font></p>
</td>
</tr>
</table>
</p>
<p style="margin-left: 18%"><font size=3><B>int attr_setf (int fd, const char</B></font> <font size=3>*</font><font size=3><B>attrname,</B></font>
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="25%">
</p>
</td>
<td valign="top" align="left" width="74%">
<p><font size=3><B>const char</B></font> <font size=3>*</font><font size=3><B>attrvalue, const int valuelength,</B></font></p>
</td>
</tr>
</table>

<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="25%">
</p>
</td>
<td valign="top" align="left" width="74%">
<p><font size=3><B>int flags);</B></font></p>
</td>
</tr>
</table>
</p>
<a name="DESCRIPTION"></a><h2>DESCRIPTION</h2><p style="margin-left: 18%"><font size=3>The</font> <font size=3><I>attr_set</I></font> <font size=3>and</font> <font size=3><I>attr_setf</I></font> <font size=3>functions provide a way to create attributes and set/change their values.</font></p>
<p style="margin-left: 18%"><font size=3><I>Path</I></font> <font size=3>points to a path name for a filesystem object, and</font> <font size=3><I>fd</I></font> <font size=3>refers to the file descriptor associated with a file. If the attribute</font> <font size=3><I>attrname</I></font> <font size=3>does not exist, an attribute with the given name and value will be created and associated with that indicated filesystem object. If an attribute with that name already exists on that filesystem object, the existing value is replaced with the new value given in this call. The new attribute value is copied from the</font> <font size=3><I>attrvalue</I></font> <font size=3>buffer for a total of</font> <font size=3><I>valuelength</I></font> <font size=3>bytes. The</font> <font size=3><I>flags</I></font> <font size=3>argument can contain the following symbols bitwise OR&eacute;d together:</font>
<table width="99%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="18%">
<p><font size=2>ATTR_ROOT</font></p>
<p><font size=2>ATTR_DONTFOLLOW ATTR_CREATE</font></p>
<p><font size=2>ATTR_REPLACE</font></p>
</td>
<td valign="top" align="left" width="63%">
<p><font size=3>Look for</font> <font size=3><I>attrname</I></font> <font size=3>in the</font> <font size=3><B>root</B></font> <font size=3>address space, not in the</font> <font size=3><B>user</B></font> <font size=3>address space. (limited to use by super&shy;user only)</font></p>
<p><font size=3>Do not follow symbolic links when resolving a</font> <font size=3><I>path</I></font> <font size=3>on an</font> <font size=3><I>attr_set</I></font> <font size=3>function call. The default is to follow symbolic links.</font></p>
<p><font size=3>Return an error (EEXIST) if an attribute of the given name already exists on the indicated filesystem object, otherwise create an attribute with the given name and value. This flag is used to implement a pure create operation, without this flag</font> <font size=3><I>attr_set</I></font> <font size=3>will create the attribute if it does not already exist. An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE are set in the same call.</font></p>
<p><font size=3>Return an error (ENOATTR) if an attribute of the given name does not already exist on the indicated filesystem object, otherwise replace the existing attribute&acute;s value with the given value. This flag is used to implement a pure replacement operation, without this flag</font> <font size=3><I>attr_set</I></font> <font size=3>will create the attribute if it does not already exist. An error (EINVAL) will be returned if both ATTR_CREATE and ATTR_REPLACE are set in the same call.</font></p>
</td>
</tr>
</table>
</p>
<p style="margin-left: 18%"><font size=3><I>attr_set</I></font> <font size=3>will fail if one or more of the following are true:</font>
<table width="98%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="15%">
<p><font size=2>[ENOATTR] [E2BIG]</font></p>
<p><font size=2>[EEXIST]</font></p>
<p><font size=2>[ENOENT]</font></p>
<p><font size=2>[EPERM]</font></p>
<p><font size=2>[ENOTDIR]</font></p>
<p><font size=2>[EACCES]</font></p>
<p><font size=2>[EINVAL]</font></p>
<p><font size=2>[EFAULT]</font></p>
</td>
<td valign="top" align="left" width="65%">
<p><font size=3>The attribute name given is not associated with the indicated filesystem object and the ATTR_REPLACE flag bit was set.</font></p>
<p><font size=3>The value of the given attribute is too large, it exceeds the maximum allowable size of an attribute value.</font></p>
<p><font size=3>The attribute name given is already associated with the indicated filesystem object and the ATTR_CREATE flag bit was set.</font></p>
<p><font size=3>The named file does not exist.</font></p>
<p><font size=3>The effective user</font> <font size=2>ID</font> <font size=3>does not match the owner of the file and the effective user</font> <font size=2>ID</font> <font size=3>is not super&shy;user.</font></p>
<p><font size=3>A component of the path prefix is not a directory.</font></p>
<p><font size=3>Search permission is denied on a component of the path prefix.</font></p>
<p><font size=3>A bit was set in the</font> <font size=3><I>flag</I></font> <font size=3>argument that is not defined for this system call, or both the ATTR_CREATE and ATTR_REPLACE flags bits were set.</font></p>
<p><font size=3><I>Path, attrname,</I></font> <font size=3>or</font> <font size=3><I>attrvalue</I></font> <font size=3>points outside the allocated address space of the process.</font></p>
</td>
</tr>
</table>
<br>
</p>

<!-- Page: 2  -->
<!-- left  margin: 220 -->
<!-- right margin: 750 -->

<table width="98%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</td>
<td valign="top" align="left" width="15%">
<p><font size=2>[ELOOP]</font></p>
</td>
<td valign="top" align="left" width="65%">
<p><font size=3>A path name lookup involved too many symbolic links.</font></p>
</td>
</tr>
</table>
<p style="margin-left: 18%"><font size=2>[ENAMETOOLONG]</font>
<table width="99%" rules="none" frame="none" cols="2" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="34%">
</p>
</td>
<td valign="top" align="left" width="65%">
<p><font size=3>The length of</font> <font size=3><I>path</I></font> <font size=3>exceeds</font> <font size=2>{</font><font size=2><I>MAXPATHLEN</I></font><font size=2>},</font> <font size=3>or a pathname component is longer than</font> <font size=2>{</font><font size=2><I>MAXNAMELEN</I></font><font size=2>}.</font></p>
</td>
</tr>
</table>
</p>
<p style="margin-left: 18%"><font size=3><I>attr_setf</I></font> <font size=3>will fail if:</font></p>
<p style="margin-left: 18%"><font size=2>[ENOATTR]</font> <font size=3>The attribute name given is not associated with the indicated filesystem<br>
<span style=" text-indent: 13%;"></span>object and the ATTR_REPLACE flag bit was set.</font></p>
<p style="margin-left: 18%"><font size=2>[E2BIG]</font> <font size=3>The value of the given attribute is too large, it exceeds the maximum<br>
<span style=" text-indent: 13%;"></span>allowable size of an attribute value.</font>
<table width="98%" rules="none" frame="none" cols="3" cellspacing="0" cellpadding="0">
<tr valign="top" align="left">
<td valign="top" align="left" width="18%">
</p>
</td>
<td valign="top" align="left" width="13%">
<p><font size=2>[EEXIST]</font></p>
<p><font size=2>[EINVAL]</font></p>
<p><font size=2>[EFAULT] [EBADF]</font></p>
</td>
<td valign="top" align="left" width="67%">
<p><font size=3>The attribute name given is already associated with the indicated filesystem object and the ATTR_CREATE flag bit was set.</font></p>
<p><font size=3>A bit was set in the</font> <font size=3><I>flag</I></font> <font size=3>argument that is not defined for this system call, or both the ATTR_CREATE and ATTR_REPLACE flags bits were set, or</font> <font size=3><I>fd<br>
</I>refers to a socket, not a file.</font></p>
<p><font size=3><I>Attrname,</I></font> <font size=3>or</font> <font size=3><I>attrvalue</I></font> <font size=3>points outside the allocated address space of the process.</font></p>
<p><font size=3><I>Fd</I></font> <font size=3>does not refer to a valid descriptor.</font></p>
</td>
</tr>
</table>
</p>
<a name="SEE ALSO"></a><h2>SEE ALSO</h2><p style="margin-left: 18%"><font size=3>attr(1),<br>
attrctl(2),<br>
attr_get(3), attr_getf(3),<br>
attr_list(3), attr_listf(3)<br>
attr_multi(3), attr_multif(3)<br>
attr_remove(3), attr_removef(3),</font></p>
<a name="DIAGNOSTICS"></a><h2>DIAGNOSTICS</h2><p style="margin-left: 18%"><font size=3>Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and</font> <font size=3><I>errno</I></font> <font size=3>is set to indicate the error.</font><br>
</p>
</body>
</html>