ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/qsetattr.htm

2077 lines
64 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Qp0lSetAttr()--Set Attributes</title>
<!-- Begin Header Records ========================================== -->
<!-- **************************************************************** -->
<!-- ****** WARNING *** WARNING *** WARNING *** WARNING ************ -->
<!-- **************************************************************** -->
<!-- If you make any changes to add the getting of new attributes -->
<!-- to this API, please contact Mike Mundy of XPF P0W so that he -->
<!-- can make similar changes to his 'attr' Qshell utility. -->
<!-- Also, consider adding Robb Wiedrich to any I0s which add -->
<!-- new function too so Java Toolbox can consider if they want -->
<!-- to add support. -->
<!-- And Don't forget to look at the CHGATR command doc too! -->
<!-- **************************************************************** -->
<!-- ****** WARNING *** WARNING *** WARNING *** WARNING ************ -->
<!-- **************************************************************** -->
<!-- Unix2 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Change History: -->
<!-- 010402 JTROUS Modify to set S_ISGID, S_ISUID V5R2, 98686 -->
<!-- 010430 JTROUS Creation Date, 98807, 2x Memory, V5R2b -->
<!-- 011022 JTROUS Changes from API Review 1, V5R2 -->
<!-- 020306 This file has undergone html cleanup on 3/06/02 by JET -->
<!-- 020307 JTROUS Changes for Virus scanner, 98860, V5R3 -->
<!-- 020407 JTROUS Changes for non-savable, 99365, V5R3a -->
<!-- 020528 JTROUS Chg QPL_ATTR_DAYS_USED_COUNT to QP0L_ATTR_RESET_DATE -->
<!-- doc in error, no change flag on this change -->
<!-- 020603 JET This file has undergone html cleanup June 2002 -->
<!-- 020528 JTROUS Add QDLS Information that was missing, v5r3b -->
<!-- 020618 EMIG: updated for NFS threadsafety, V5R3 -->
<!-- 020719 MFENLON: updated for QFileSvr.400 threadsafety, V5R3 -->
<!-- 020829 RTHEIS : S_ISVTX mode bit, V5R3c -->
<!-- 020924 VONBERGE: Fix QSYS.LIB authority, P9A09413 -->
<!-- 021015 JETAYLOR: Fixed link to QsrSave.htm and fixed non-ended comment-->
<!-- 030415 JTROUS : Add missing QFileSvr.400, QNTC uid etc note, v5r3c -->
<!-- and add ALWSAV restriction for QFileSvr.400 -->
<!-- 030520 JTROUS : Updates to non-savable description -->
<!-- 030609 JTROUS : Change EACCESS to EPERM for GID etc changes -->
<!-- 030919 JTROUS : Fixups on ENOTSUPs for NFS (if *OBJMGT), v5r3c -->
<!-- 031006 JTROUS : Fixups on QSYS.LIB wording in usage, no change flg-->
<!-- 040324 TIMCLARK: Add virtual volume and NWSSTG restriction for scan status. -->
<!-- 040615 JTROUS : Fixups on table layout, no change flg -->
<!-- 040721 JTROUS: fix OS/400 reference, no change flag, V5R4 -->
<!-- 050117 JTROUS: fix QNTC restrictions, V5R4, XPF PTR 9A87597, -->
<!-- and Errno updates (not change flagged) -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<a name="top_Of_Page"></a>
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<h2>Qp0lSetAttr()--Set Attributes</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;Qp0lstdi.h&gt;
int Qp0lSetAttr
(Qlg_Path_Name_T *<em>Path_Name</em>,
char *<em>Buffer_ptr</em>,
uint <em>Buffer_Size</em>,
uint <em>Follow_Symlnk, ...</em>);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QP0LLIB3<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Conditional; see <a href="#usage_notes">Usage
Notes</a>.<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>Qp0lSetAttr()</strong> function sets one of a set of defined
attributes, on each call, for the object that is referred to by the input
*<em>Path_Name</em>. The object must exist, the user must have authority to it,
and the attribute must be supported by the file system to which the object
belongs. When an attribute is not supported by the file system, <strong>
Qp0lSetAttr()</strong> will fail with ENOTSUP. See the <a href="#usage_notes">Usage
Notes</a> for
more information.</p>
<p>If the last component of the <em>Path_Name</em> parameter is a symbolic
link, the <strong>Qp0lSetAttr()</strong> either sets the attribute of the
symbolic link or sets the attribute of the object that the symbolic link names.
This depends on the value of the <em>Follow_Symlnk</em> parameter.</p>
<p>All times that are set by <strong>Qp0lSetAttr()</strong> are in seconds
since the Epoch so that they are consistent with UNIX-type APIs. The Epoch is
the time 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal
Time. If the system date is set prior to 1970, all time values will be
zero.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong><em>Path_Name</em></strong></dt>
<dd>(Input) The path name of the object for which attribute information is set.
This path name is in the Qlg_Path_Name_T format. For more information on this
structure, see <a href="../apiref/pns.htm">Path name format</a>.<br>
<br>
</dd>
<dt><strong><em>Buffer_ptr</em></strong></dt>
<dd>(Input) A pointer to a buffer containing a constant that identifies the
attribute and the value for the attribute that <strong>Qp0lSetAttr()</strong>
sets. The number of bytes allocated for this buffer is in the <em>
Buffer_Size</em> parameter.
<p>The following table describes the format of the entry in the buffer.</p>
<table border width="80%">
<tr>
<th align="left" valign="bottom" colspan="4"><em><a name="Table_1-1">Buffer
Pointer</a></em></th>
</tr>
<tr>
<th align="center" valign="bottom" colspan="2">Offset</th>
<th align="left" valign="bottom" rowspan="2">Type</th>
<th align="left" valign="bottom" rowspan="2">Field</th>
</tr>
<tr>
<th align="center" valign="bottom">Dec</th>
<th align="center" valign="bottom">Hex</th>
</tr>
<tr>
<td align="center" valign="top" width="10">0</td>
<td align="center" valign="top" width="10">0</td>
<td align="left" valign="top" width="20%">BINARY(4)</td>
<td align="left" valign="top" width="60%">Offset to next attribute entry</td>
</tr>
<tr>
<td align="center" valign="top">4</td>
<td align="center" valign="top">4</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Attribute identification</td>
</tr>
<tr>
<td align="center" valign="top">8</td>
<td align="center" valign="top">8</td>
<td align="left" valign="top">BINARY(4)</td>
<td align="left" valign="top">Size of attribute data</td>
</tr>
<tr>
<td align="center" valign="top">12</td>
<td align="center" valign="top">C</td>
<td align="left" valign="top">CHAR(4)</td>
<td align="left" valign="top">Reserved</td>
</tr>
<tr>
<td align="center" valign="top">16</td>
<td align="center" valign="top">10</td>
<td align="left" valign="top">CHAR(*)</td>
<td align="left" valign="top">Attribute data</td>
</tr>
</table>
<p><strong>Attribute data.</strong> The value to which the attribute is
set.</p>
<p><strong>Attribute identification.</strong> The constant identifying the
attribute being set. Valid values are:</p>
<table cellpadding="5">
<!-- cols="10 90" -->
<tr>
<td align="left" valign="top"><em>4</em></td>
<td align="left" valign="top">QP0L_ATTR_CREATE_TIME: (UNSIGNED (BINARY(4)) The
time the object was created.</td>
</tr>
<tr>
<td align="left" valign="top"><em>5</em></td>
<td align="left" valign="top">QP0L_ATTR_ACCESS_TIME: (UNSIGNED (BINARY(4)) The
time the object's data was last accessed.</td>
</tr>
<tr>
<td align="left" valign="top"><em>7</em></td>
<td align="left" valign="top">QP0L_ATTR_MODIFY_TIME: (UNSIGNED (BINARY(4)) The
time the object's data was last changed.</td>
</tr>
<tr>
<td align="left" valign="top"><em>17</em></td>
<td align="left" valign="top">QP0L_ATTR_PC_READ_ONLY: (CHAR(1)) Whether the
object can be written to or deleted, have its extended attributes changed or
deleted, or have its size changed. Valid values are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_PC_NOT_READONLY: The object can be
changed.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_PC_READONLY: The object cannot be
changed.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>18</em></td>
<td align="left" valign="top">QP0L_ATTR_PC_HIDDEN: (CHAR(1)) Whether the object
can be displayed using an ordinary directory listing.
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_PC_NOT_HIDDEN: The object is not
hidden.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_PC_HIDDEN: The object is hidden.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>19</em></td>
<td align="left" valign="top">QP0L_ATTR_PC_SYSTEM: (CHAR(1)) Whether the object
is a system file and is excluded from normal directory searches.
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_PC_NOT_SYSTEM: The object is not a system
file.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_PC_SYSTEM: The object is a system file.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>20</em></td>
<td align="left" valign="top">QP0L_ATTR_PC_ARCHIVE: (CHAR(1)) Whether the
object has changed since the last time the file was saved or reset by a PC
client.
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_PC_NOT_CHANGED: The object has not
changed.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_PC_CHANGED: The object has changed.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>21</em></td>
<td align="left" valign="top">QP0L_ATTR_SYSTEM_ARCHIVE: (CHAR(1)) Whether the
object has changed and needs to be saved. It is set on when an object's change
time is updated, and set off when the object has been saved.
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_SYSTEM_NOT_CHANGED: The object has not
changed and does not need to be saved.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_SYSTEM_CHANGED: The object has changed and
does need to be saved.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>22</em></td>
<td align="left" valign="top">QP0L_ATTR_CODEPAGE: (BINARY(4))&nbsp;&nbsp; The
code page used to derive a coded character set identifier (CCSID) used for the
data in the file or the extended attributes of the directory.</td>
</tr>
<tr>
<td align="left" valign="top"><em>26</em></td>
<td align="left" valign="top">QP0L_ATTR_ALWCKPWRT: (CHAR(1)) Whether a stream
file (*STMF) can be shared with readers and writers during the
save-while-active checkpoint processing. Setting this attribute may cause
unexpected results.
See the <a href="../rzaiu/rzaiuintro.htm" target="_blank">Back up your server</a>
topic for details on this attribute.
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_NOT_ALWCKPWRT: The object can be shared with
readers only.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_ALWCKPWRT: The object can be shared with
readers and writers.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>27</em></td>
<td align="left" valign="top">QP0L_ATTR_CCSID: (BINARY(4)) The CCSID of the
data and extended attributes of the object.<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>31</em></td>
<td align="left" valign="top">QP0L_ATTR_DISK_STG_OPT (CHAR(1)) Which option
should be used to determine how auxiliary storage is allocated by the system
for the specified object. The option will take effect immediately and be part
of the next auxiliary storage allocation for the object. This option can only
be specified for byte stream files in the "root" (/), QOpenSys and user-defined
file systems. This option will be ignored for *TYPE1 byte stream files. Valid
values are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_STG_NORMAL: The auxiliary storage will be
allocated normally. That is, as additional auxiliary storage is required, it
will be allocated in logically sized extents to accomodate the current space
requirement, and anticipated future requirements, while minimizing the number
of disk I/O operations. If the QP0L_ATTR_DISK_STG_OPT attribute has not been
specified for an object, this value is the default.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_STG_MINIMIZE: The auxiliary storage will be
allocated to minimize the space used by the object. That is, as additional
auxiliary storage is required, it will be allocated in small sized extents to
accomodate the current space requirement. Accessing an object composed of many
small extents may increase the number of disk I/O operations for that
object.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'02'</em></td>
<td align="left" valign="top">QP0L_STG_DYNAMIC: The system will dynamically
determine the optimum auxiliary storage allocation for the object, balancing
space used versus disk I/O operations. For example, if a file has many small
extents, yet is frequently being read and written, then future auxiliary
storage allocations will be larger extents to minimize the number of disk I/O
operations. Or, if a file is frequently truncated, then future auxiliary
storage allocations will be small extents to minimize the space used.
Additionally, information will be maintained on the byte stream file sizes for
this system and its activity. This file size information will also be used to
help determine the optimum auxiliary storage allocations for this object as it
relates to the other objects sizes.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>32</em></td>
<td align="left" valign="top">QP0L_ATTR_MAIN_STG_OPT: (CHAR(1)) Which option
should be used to determine how main storage is allocated and used by the
system for the specified object. The option will take effect the next time the
specified object is opened. This option can only be specified for byte stream
files in the "root" (/), QOpenSys and user-defined file systems. Valid values
are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_STG_NORMAL: The main storage will be
allocated normally. That is, as much main storage as possible will be allocated
and used. This minimizes the number of disk I/O operations since the
information is cached in main storage. If the QP0L_ATTR_MAIN_STG_OPT attribute
has not been specified for an object, this value is the default.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_STG_MINIMIZE: The main storage will be
allocated to minimize the space used by the object. That is, as little main
storage as possible will be allocated and used. This minimizes main storage
usage while increasing the number of disk I/O operations since less information
is cached in main storage.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'02'</em></td>
<td align="left" valign="top">QP0L_STG_DYNAMIC: The system will dynamically
determine the optimum main storage allocation for the object depending on other
system activity and main storage contention. That is, when there is little main
storage contention, as much storage as possible will be allocated and used to
minimize the number of disk I/O operations. And when there is significant main
storage contention, less main storage will be allocated and used to minimize
the main storage contention.
<img src="delta.gif" alt="Start of change">
This option only has an effect when the storage pool's paging option
is *CALC. When the storage pool's paging option is *FIXED, the
behavior is the same as *NORMAL. When the object is accessed
through a file server, this option has no effect. Instead, its
behavior is the same as *NORMAL.
<img src="deltaend.gif" alt="End of change">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>35</em></td>
<td align="left" valign="top">QP0L_ATTR_CRTOBJSCAN: (CHAR(1)) Whether the
objects created in a directory will be scanned when exit programs are
registered with any of the integrated file system scan-related exit points.
<p>The integrated file system scan-related exit points are:</p>
<ul>
<li><a href="ifscloseexit.htm">Integrated File System Scan on Close Exit
Programs</a></li>
<li><a href="ifsopenexit.htm">Integrated File System Scan on Open Exit
Programs</a>.</li>
</ul>
<p>This attribute can only be specified for directories in the "root" (/), QOpenSys
and user-defined file systems. Even though this attribute can be set for *TYPE1
and *TYPE2 directories, only objects which are in *TYPE2 directories will
actually be scanned, no matter what value is set for this attribute.</p>
<p>Valid values are:</p>
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_SCANNING_NO: After an object is created in
the directory, the object will not be scanned according to the rules described
in the scan-related exit programs.
<p><strong>Note:</strong>
If the Scan file systems control (QSCANFSCTL) value *NOPOSTRST is not
specified when an object with this attribute is restored, the object will
be scanned at least once after the restore.</p></td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_SCANNING_YES: After an object is created in
the directory, the object will be scanned according to the rules described in
the scan-related exit programs if the object has been modified or if the
scanning software has been updated since the last time the object was scanned.
If the QP0L_ATTR_CRTOBJSCAN attribute has not been specified for a directory,
this value is the default.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'02'</em></td>
<td align="left" valign="top">QP0L_SCANNING_CHGONLY: After an object is created
in the directory, the object will be scanned according to the rules described
in the scan-related exit programs only if the object has been modified since
the last time the object was scanned. It will not be scanned if the scanning
software has been updated. This attribute only takes effect if the Scan
file systems control (QSCANFSCTL) system value has *USEOCOATR
specified. Otherwise, it will be treated as if the attribute is
QP0L_SCANNING_YES.
<p><strong>Note:</strong>
If the Scan file systems control (QSCANFSCTL) value *NOPOSTRST is not
specified when an object with this attribute is restored, the object will
be scanned at least once after the restore.</p></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>36</em></td>
<td align="left" valign="top">QP0L_ATTR_SCAN: (CHAR(1)) Whether the object
will be scanned when exit programs are registered with any of the integrated
file system scan-related exit points.
<p>The integrated file system scan-related exit points are:</p>
<ul>
<li><a href="ifscloseexit.htm">Integrated File System Scan on Close Exit
Programs</a></li>
<li><a href="ifsopenexit.htm">Integrated File System Scan on Open Exit
Programs</a>.</li>
</ul>
<p>This attribute can only be specified for stream files in the "root" (/), QOpenSys
and user-defined file systems <img src="delta.gif" alt="Start of change">
that are not virtual volumes or network server storage spaces.
<img src="deltaend.gif" alt="End of change">
Even though this attribute can be set for
objects in *TYPE1 and *TYPE2 directories, only objects which are in *TYPE2
directories will actually be scanned, no matter what value is set for this
attribute.</p>
<p>Valid values are:</p>
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_SCANNING_NO: The object will not be scanned
according to the rules described in the scan-related exit programs.
<p><strong>Note:</strong>
If the Scan file systems control (QSCANFSCTL) value *NOPOSTRST is not
specified when an object with this attribute is restored, the object will
be scanned at least once after the restore.</p></td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_SCANNING_YES: The object will be scanned
according to the rules described in the scan-related exit programs if the
object has been modified or if the scanning software has been updated since the
last time the object was scanned. If the QP0L_ATTR_SCAN attribute has not been
specified for an object, this value is the default.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'02'</em></td>
<td align="left" valign="top">QP0L_SCANNING_CHGONLY: The object will be scanned
according to the rules described in the scan-related exit programs only if the
object has been modified since the last time the object was scanned. It will
not be scanned if the scanning software has been updated. This attribute only
takes effect if the Scan file systems control (QSCANFSCTL) system
value has *USEOCOATR specified. Otherwise, it will be treated as if the
attribute is QP0L_SCANNING_YES.
<p><strong>Note:</strong>
If the Scan file systems control (QSCANFSCTL) value *NOPOSTRST is not
specified when an object with this attribute is restored, the object will
be scanned at least once after the restore.</p></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>38</em></td>
<td align="left" valign="top">QP0L_ATTR_ALWSAV: (CHAR(1)) Whether the object
can be saved or not.
<p><strong>Note:</strong> It is highly recommended that this attribute not be
changed for any system created objects.</p>
<p>Valid values are:</p>
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_ALWSAV_NO: This object will not be saved
when using the Save Object (SAV) command or the <a href="QsrSave.htm">
QsrSave()</a> API.
<p>Additionally, if this object is a directory, none of the objects in the
directory's subtree will be saved unless they were explicitly specified as an
object to be saved. The subtree includes all subdirectories and the objects
within those subdirectories.</p>
<p><strong>Note:</strong>
If this attribute is chosen for an object that has private authorities
associated with it, or is chosen for the directory of an object
that has private authorities associated with it, then the
following consideration applies. When the private authorities are saved,
the fact that an object has the QP0L_ALWSAV_NO attribute is not taken into
consideration.
(Private authorities can be saved using either the Save System (SAVSYS) or
Save Security Data (SAVSECDTA) command or the
<a href="qsrsavo.htm">Save Object List (QSRSAVO)</a> API.)
Therefore, when a private authority is restored using the
Restore Authority (RSTAUT) command, message CPD3776 will be seen for each
object that was not saved either because it had the QP0L_ALWSAV_NO
attribute specified, or because the object was not specified on the save and
it was in a directory that had the QP0L_ALWSAV_NO attribute specified.
</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_ALWSAV_YES: This object will be saved when
using the Save Object (SAV) command or the <a href="QsrSave.htm">QsrSave()</a>
API. If the QP0L_ATTR_ALWSAV attribute has not been specified for an object,
this value is the default.
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>39</em></td>
<td align="left" valign="top">QP0L_ATTR_RSTDRNMUNL: (CHAR(1))
Restricted renames and unlinks for objects within a directory. Objects can be linked into
a directory that has this attribute set on, but cannot be renamed or unlinked from it
unless one or more of the following are true for the user performing the operation:
<ul><li>The user is the owner of the object.</li>
<li>The user is the owner of the directory.</li>
<li>The user has *ALLOBJ special authority.</li>
</ul>
This restriction only applies to directories.
Other types of object can have this attribute on, however, it will be ignored.
In addition, this attribute can only be specified for objects within the Network File System (NFS),
QFileSvr.400, "root" (/), QOpenSys, or user-defined file systems. Both the NFS and QFileSvr.400
file systems support this attribute by passing it to the server and surfacing it to the caller.
This attribute is also equivalent to the S_ISVTX mode bit for an object.
Valid values are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_RSTDRNMUNL_OFF: No additional restrictions
for rename and unlink operations.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_RSTDRNMUNL_ON: Additional restrictions
for rename and unlink operations.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><img src="delta.gif" alt="Start of change">
<em>41</em></td>
<td align="left" valign="top">QP0L_ATTR_CRTOBJAUD: (CHAR(10)) The create object auditing value
associated with the directory. This is the auditing value given to any objects
created in the directory.
This attribute can only be specified for directories
in the "root" (/), QOpenSys, QSYS.LIB, independent ASP QSYS.LIB,
QFileSvr.400 and user-defined file systems.
<p>Valid values are: </p>
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>*SYSVAL</em></td>
<td align="left" valign="top">QP0L_AUD_SYSVAL:
The object auditing value for the objects created in the
directory is determined by the system auditing value (QCRTOBJAUD).</td>
</tr>
<tr>
<td align="left" valign="top"><em>*NONE</em></td>
<td align="left" valign="top">QP0L_AUD_NONE:
No auditing occurs for this object when it is
read or changed regardless of the user who is accessing the object.</td>
</tr>
<tr>
<td align="left" valign="top"><em>*USRPRF</em></td>
<td align="left" valign="top">QP0L_AUD_USRPRF:
Audit this object only if the current user is
being audited. The current user is tested to determine if auditing should be
done for this object. The user profile can specify if only change access is
audited or if both read and change accesses are audited for this object.
The OBJAUD parameter of the Change User Auditing (CHGUSRAUD) command
is used to change the auditing for a specific user.
</td>
</tr>
<tr>
<td align="left" valign="top"><em>*CHANGE</em></td>
<td align="left" valign="top">QP0L_AUD_CHANGE:
Audit all change access to this object by all
users on the system.</td>
</tr>
<tr>
<td align="left" valign="top"><em>*ALL</em></td>
<td align="left" valign="top">QP0L_AUD_ALL:
Audit all access to this object by all users on
the system. All access is defined as a read or change operation.</td>
<td><img src="deltaend.gif" alt="End of change"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>200</em></td>
<td align="left" valign="top">QP0L_ATTR_RESET_DATE: (UNSIGNED (BINARY(2)) The
count of the number of days an object has been used. Usage has different
meanings according to the file system and according to the individual object
types supported within a file system. Usage can indicate the opening or closing
of a file or can refer to adding links, renaming, restoring, or checking out an
object. The usage information format is defined in the Qp0lstdi.h header file
as data type Qp0l_Usage_t and is shown in the following table. This attribute
can be set to zero only. An attempt to set to any other value will result in
<em>errno</em> [EINVAL].
<p>When this attribute is set, the date use count reset for the object is set
to the current date.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>300</em></td>
<td align="left" valign="top">QP0L_ATTR_SUID: (CHAR(1)) Set effective user ID
(UID) at execution time. This value is ignored if the specified object is a
directory. Valid values are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_SUID_OFF: The user ID (UID) is not set at
execution time.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_SUID_ON: The object owner is the effective
user ID (UID) at execution time.</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>301</em></td>
<td align="left" valign="top">QP0L_ATTR_SGID: (CHAR(1)) Set effective group ID
(GID) at execution time. Valid values are:
<table cellpadding="5">
<tr>
<td align="left" valign="top"><em>x'00'</em></td>
<td align="left" valign="top">QP0L_SGID_OFF: If the object is a file, the group
ID (GID) is not set at execution time. If the object is a directory in the
"root" (/), QOpenSys, and user-defined file systems, the group ID (GID) of objects
created in the directory is set to the effective GID of the thread creating the
object. This value cannot be set for other file systems.</td>
</tr>
<tr>
<td align="left" valign="top"><em>x'01'</em></td>
<td align="left" valign="top">QP0L_SGID_ON: If the object is a file, the group
ID (GID) is set at execution time. If the object is a directory, the group ID
(GID) of objects created in the directory is set to the GID of the parent
directory.</td>
</tr>
</table>
</td>
</tr>
</table>
<p><strong>Offset to next attribute entry.</strong> (Output) This field is not
used by the <strong>Qp0lSetAttr()</strong> function. It is provided for
alignment so that the same buffer format returned from the <strong>
Qp0lGetAttr()</strong> function can be used as input to the <strong>
Qp0lSetAttr()</strong> function.</p>
<p><strong>Reserved.</strong> A reserved field. This field must be set to
binary zero.</p>
<p><strong>Size of attribute data.</strong> The exact size of the data for this
attribute. If this size does not match the size that the system stores for this
attribute, [EINVAL] is returned.</p>
</dd>
</dl>
<dl>
<dt><strong><em>Buffer_Size</em></strong></dt>
<dd>(Input) The size in bytes of the buffer pointed to by the <em>
Buffer_ptr</em> parameter.<br>
<br>
</dd>
<dt><strong><em>Follow_Symlnk</em></strong></dt>
<dd>(Input) If the last component in the *<em>Path_Name</em> is a symbolic
link, <strong>Qp0lSetAttr()</strong> either acts upon the symbolic link or the
path contained in the symbolic link. This depends on the value of the <em>
Follow_Symlnk</em> parameter. Valid values are:
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">QP0L_DONOT_FOLLOW_SYMLNK: A symbolic link in the
last component is not followed. Attributes of the symbolic link object are
set.</td>
</tr>
<tr>
<td align="left" valign="top"><em>1</em></td>
<td align="left" valign="top">QP0L_FOLLOW_SYMLNK: A symbolic link in the last
component is followed. The attributes of the object contained in the symbolic
link are set.</td>
</tr>
</table>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p><strong>Note:</strong> Adopted authority is not used.</p>
<table border width="100%">
<tr>
<th align="left" valign="bottom" colspan="3"><em><a name="TBLASWP11">
Authorization Required for Qp0lSetAttr() (excluding QSYS.LIB, independent
ASP QSYS.LIB,
and QDLS)
</a></em></th>
</tr>
<tr>
<th align="left" valign="bottom">Object Referred to</th>
<th align="left" valign="bottom">Authority Required</th>
<th align="left" valign="bottom">errno</th>
</tr>
<tr>
<td align="left" valign="top" width="65%">Each directory, preceding the last
component, in the <em>path name</em>
<img src="delta.gif" alt="Start of change">
except when setting the QP0L_ATTR_CRTOBJAUD attribute.
<img src="deltaend.gif" alt="End of change">
</td>
<td align="left" valign="top" width="20%">*X</td>
<td align="left" valign="top" width="15%">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_RESET_DATE,
QP0L_ATTR_ALWCKPWRT,
QP0L_ATTR_ALWSAV,
QP0L_ATTR_DISK_STG_OPT or QP0L_ATTR_MAIN_STG_OPT attribute</td>
<td align="left" valign="top">*OBJMGT</td>
<td align="left" valign="top">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_CREATE_TIME,
QP0L_ATTR_ACCESS_TIME, or QP0L_ATTR_MODIFY_TIME attribute to the current
time</td>
<td align="left" valign="top">Owner or *W (See <strong>Note</strong>)</td>
<td align="left" valign="top">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the
QP0L_ATTR_RSTDRNMUNL,
QP0L_ATTR_SUID, or
QP0l_ATTR_SGID values</td>
<td align="left" valign="top">Owner (See <strong>Note</strong>)</td>
<td align="left" valign="top">
EPERM</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_CREATE_TIME,
QP0L_ATTR_ACCESS_TIME, or QP0L_ATTR_MODIFY_TIME attribute to a specific
time</td>
<td align="left" valign="top">*W</td>
<td align="left" valign="top">EPERM</td>
</tr>
<tr>
<td align="left" valign="top">
User, when setting the QP0L_ATTR_CRTOBJSCAN or QP0L_ATTR_SCAN attribute</td>
<td align="left" valign="top">*ALLOBJ, *SECADM</td>
<td align="left" valign="top">EPERM</td>
</tr>
<tr>
<td align="left" valign="top"><img src="delta.gif" alt="Start of change">
User, when setting the QP0L_ATTR_CRTOBJAUD attribute</td>
<td align="left" valign="top">*AUDIT</td>
<td align="left" valign="top">EPERM
<img src="deltaend.gif" alt="End of change"></td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting any other attribute</td>
<td align="left" valign="top">*W</td>
<td align="left" valign="top">EACCES</td>
</tr>
<tr>
<td align="left" valign="top" colspan="3"><strong>Note:</strong> If the file
system supports *ALLOBJ special authority and if you have *ALLOBJ special
authority, you do not need the listed object authority.</td>
</tr>
</table>
<br>
<br>
<table border width="100%">
<tr>
<th align="left" valign="bottom" colspan="3"><em><a name="TBLASWP12">
Authorization Required for Qp0lSetAttr() in the QSYS.LIB and independent ASP
QSYS.LIB File Systems</a></em></th>
</tr>
<tr>
<th align="left" valign="bottom">Object Referred to</th>
<th align="left" valign="bottom">Authority Required</th>
<th align="left" valign="bottom">errno</th>
</tr>
<tr>
<td align="left" valign="top" width="65%">Each directory, preceding the last
component, in the <em>path name</em>
<img src="delta.gif" alt="Start of change">
except when setting the QP0L_ATTR_CRTOBJAUD attribute.
<img src="deltaend.gif" alt="End of change">
</td>
<td align="left" valign="top" width="20%">*X</td>
<td align="left" valign="top" width="15%">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_RESET_DATE
attribute and the object type is *FILE</td>
<td align="left" valign="top">*OBJOPR and *OBJMGT</td>
<td align="left" valign="top">EACCES or EPERM</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_RESET_DATE
attribute and the object is a database file member</td>
<td align="left" valign="top">*X and *OBJMGT</td>
<td align="left" valign="top">EACCES or EPERM</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_RESET_DATE
attribute and the object is neither a *FILE object type nor a database file
member</td>
<td align="left" valign="top">*OBJMGT</td>
<td align="left" valign="top">EACCES or EPERM</td>
</tr>
<tr>
<td align="left" valign="top"><img src="delta.gif" alt="Start of change">
User, when setting the QP0L_ATTR_CRTOBJAUD attribute</td>
<td align="left" valign="top">*AUDIT</td>
<td align="left" valign="top">EPERM
<img src="deltaend.gif" alt="End of change"></td>
</tr>
</table>
<br>
<br>
<table border width="100%">
<tr>
<th align="left" valign="bottom" colspan="3">
<em>Authorization Required for Qp0lSetAttr() in the QDLS File System</em></th>
</tr>
<tr>
<th align="left" valign="bottom">Object Referred to</th>
<th align="left" valign="bottom">Authority Required</th>
<th align="left" valign="bottom">errno</th>
</tr>
<tr>
<td align="left" valign="top" width="65%">Each directory, preceding the last
component, in the <em>path name</em></td>
<td align="left" valign="top" width="20%">*X</td>
<td align="left" valign="top" width="15%">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting the QP0L_ATTR_RESET_DATE attribute</td>
<td align="left" valign="top">*W, *OBJMGT (See <strong>Note</strong>)</td>
<td align="left" valign="top">EACCES</td>
</tr>
<tr>
<td align="left" valign="top">Object, when setting any other attribute</td>
<td align="left" valign="top">*W (See <strong>Note</strong>) </td>
<td align="left" valign="top">EACCES</td>
</tr>
<tr>
<td align="left" valign="top" colspan="3"><strong>Note:</strong>
If you have *ALLOBJ special
authority, you do not need the listed object authority.</td>
</tr>
</table>
<br>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">The <strong>Qp0lSetAttr() API</strong> was
successful.</td>
</tr>
<tr>
<td align="left" valign="top"><em>-1</em></td>
<td align="left" valign="top">The <strong>Qp0lSetAttr() API</strong> was not
successful. The <em>errno</em> global variable is set to indicate the
error.</td>
</tr>
</table>
<br>
<br>
<h3>Error Conditions</h3>
<p>If the <strong>Qp0lSetAttr() API</strong> is not successful, <em>errno</em>
indicates one of the following errors:</p>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<th align="left" valign="bottom">Error condition</th>
<th align="left" valign="bottom">Additional information</th>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EACCES">EACCES</a>]</em></td>
<td align="left" valign="top">
<p>If you are accessing a remote file through the Network File System, update
operations to file permissions at the server are not reflected at the client
until updates to data that is stored locally by the Network File System take
place. (Several options on the Add Mounted File System (ADDMFS) command
determine the time between refresh operations of local data.) Access to a
remote file may also fail due to different mappings of user IDs (UID) or group
IDs (GID) on the local and remote systems.</p>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EAGAIN">EAGAIN</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EBADFID">EBADFID</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EBADNAME">EBADNAME</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EBUSY">EBUSY</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ECANCEL">ECANCEL</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ECONVERT">ECONVERT</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EDAMAGE">EDAMAGE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EFAULT">EFAULT</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EINTR">EINTR</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EINVAL">EINVAL</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EIO">EIO</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EJRNDAMAGE">EJRNDAMAGE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EJRNENTTOOLONG">EJRNENTTOOLONG</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EJRNINACTIVE">EJRNINACTIVE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EJRNRCVSPC">EJRNRCVSPC</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ELOOP">ELOOP</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENAMETOOLONG">ENAMETOOLONG</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENEWJRN">ENEWJRN</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENEWJRNRCV">ENEWJRNRCV</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOENT">ENOENT</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOMEM">ENOMEM</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOSPC">ENOSPC</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOTAVAIL">ENOTAVAIL</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOTDIR">ENOTDIR</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOTSAFE">ENOTSAFE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENOTSUP">ENOTSUP</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EOFFLINE">EOFFLINE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EPERM">EPERM</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EROOBJ">EROOBJ</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ESCANFAILURE">ESCANFAILURE</a>]</em></td>
<td align="left" valign="top">
<p>You have attempted to modify an object that has been marked as a scan
failure due to processing by an exit program associated with the scan-related
integrated file system exit points.</p>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EUNKNOWN">EUNKNOWN</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
</table>
<p>Additionally, if interaction with a file server is required to access the
object, <em>errno</em> could also indicate one of the following errors:</p>
<table cellpadding="5">
<!-- cols="25 75" -->
<tr>
<th align="left" valign="bottom">Error condition</th>
<th align="left" valign="bottom">Additional information</th>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EADDRNOTAVAIL">EADDRNOTAVAIL</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ECONNABORTED">ECONNABORTED</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ECONNREFUSED">ECONNREFUSED</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ECONNRESET">ECONNRESET</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EHOSTDOWN">EHOSTDOWN</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EHOSTUNREACH">EHOSTUNREACH</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENETDOWN">ENETDOWN</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENETRESET">ENETRESET</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ENETUNREACH">ENETUNREACH</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ESTALE">ESTALE</a>]</em></td>
<td align="left" valign="top">
<p>If you are accessing a remote file through the Network File System, the file
may have been deleted at the server.</p>
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ETIMEDOUT">ETIMEDOUT</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#EUNATCH">EUNATCH</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
</table>
<br>
<h3>Error Messages</h3>
<p>The following messages may be sent from this function:</p>
<table width="100%" cellpadding="5">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top" nowrap>Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td align="left" valign="top">CPFA0D4 E</td>
<td align="left" valign="top">File system error occurred. Error number
&amp;1.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF2 E</td>
<td align="left" valign="top">Error(s) occurred during running of &amp;1
API.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9872 E</td>
<td align="left" valign="top">Program or service program &amp;1 in library
&amp;2 ended. Reason code &amp;3.</td>
</tr>
<tr>
<td align="left" valign="top">CPE3418 E</td>
<td align="left" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
</table>
<br>
<br>
<h3><a name="usage_notes">Usage Notes</a></h3>
<ol>
<li>This function will fail with error code [ENOTSAFE] when all the following
conditions are true:<br>
<br>
<ul>
<li>Where multiple threads exist in the job.<br>
<br>
</li>
<li>The object on which this function is operating resides in a file system
that is not threadsafe. Only the following file systems are threadsafe for this
function:
<ul>
<li>"Root" (/)</li>
<li>QOpenSys</li>
<li>User-defined</li>
<li>QNTC</li>
<li>QSYS.LIB</li>
<li>Independent ASP QSYS.LIB</li>
<li>QOPT</li>
<li>Network File System</li>
<li>QFileSvr.400</li>
</ul>
</li>
</ul>
<br>
</li>
<li>"Root" (/), QOpenSys, and User-Defined File System Differences
<p>The QP0L_ATTR_CREATE_TIME and QP0L_ATTR_RESET_DATE attributes are supported
for objects of type *STMF only. Attempts to set them on other objects will
result in the operation failing with <em>errno</em> set to [ENOTSUP].</p>
<p>The QP0L_ALWSAV_YES value
cannot be specified for the QP0L_ATTR_ALWSAV attribute for /dev/null, /dev/zero
or objects of type *SOCKET. Attempts to set it on these objects will result in
the operation failing with <em>errno</em> set to [ENOTSUP]. </p>
<p>
The QP0L_ATTR_SGID attribute of the directory affects what the group ID (GID)
is for objects that are created in the directory. If the QP0L_ATTR_SGID attribute
of the parent directory is off, the group ID (GID) is set to the effective GID
of the thread creating the object. If the QP0L_ATTR_SGID attribute of the parent
directory is on, the group ID (GID) of the new object is set to the GID of the
parent directory. For all other file systems, the GID of the new object is set
to the GID of the parent directory.
</p>
<p>
When setting the QP0L_ATTR_RSTDRNMUNL, QP0L_ATTR_SUID, or QP0L_ATTR_SGID attributes
on an object that has a primary group, it must match the primary group ID or one
of the supplemental group IDs of the caller of this API; otherwise, the
QP0L_ATTR_SGID attribute is set to QP0L_SGID_OFF.
</p>
</li>
<li>QSYS.LIB and Independent ASP QSYS.LIB File System Differences
<p>The following attributes may be set on objects in these file systems:</p>
<ul>
<li><img src="delta.gif" alt="Start of change">
QP0L_ATTR_CRTOBJAUD
<img src="deltaend.gif" alt="End of change">
</li>
<li>QP0L_ATTR_RESET_DATE
<p>When you set the QP0L_ATTR_RESET_DATE attribute of a database file, all
members in that file will have their days used count reset to 0 also.</p>
</li>
</ul>
<p>Attempting to set any other attribute other than QP0L_ATTR_SUID or
QP0L_ATTR_SGID
will result in the operation failing
with <em>errno</em> set to [ENOTSUP].</p>
<p>
QSYS.LIB and Independent ASP QSYS.LIB do not support setting the
QP0L_ATTR_SUID or QP0L_ATTR_SGID attributes. They will be ignored if specified.
</p>
</li>
<li>Network File System Differences
<p>When you set the following attributes on objects in the Network File System,
the operation will fail with the <em>errno</em> set to [ENOTSUP] if the
attribute is not set to the following attribute value.</p>
<ul>
<li>If set, QP0L_ATTR_PC_READ_ONLY must be set to an attribute value of
QP0L_PC_NOT_READ_ONLY.<br>
<br>
</li>
<li>If set, QP0L_ATTR_PC_HIDDEN must be set to an attribute value of
QP0L_PC_NOT_HIDDEN.<br>
<br>
</li>
<li>If set, QP0L_ATTR_PC_SYSTEM must be set to an attribute value of
QP0L_PC_NOT_SYSTEM.<br>
<br>
</li>
<li>If set, QP0L_ATTR_PC_ARCHIVE must be set to an attribute value of
QP0L_PC_NOT_CHANGED; however, if the object is of type *STMF, the attribute
value must be QP0L_PC_CHANGED.<br>
<br>
</li>
<li>If set, QP0L_ATTR_SYSTEM_ARCHIVE must be set to an attribute value of
QP0L_SYSTEM_NOT_CHANGED.<br>
<br>
</li>
</ul>
<p>The QP0L_ATTR_CREATE_TIME, QP0L_ATTR_RESET_DATE, QP0L_ATTR_CODEPAGE,
QP0L_ATTR_CCSID,
QP0L_ATTR_ALWSAV, QP0L_ATTR_ALWCKPWRT, QP0L_ATTR_DISK_STG_OPT, QP0L_ATTR_MAIN_STG_OPT
<img src="delta.gif" alt="Start of change">
and QP0L_ATTR_CRTOBJAUD
<img src="deltaend.gif" alt="End of change">
attributes cannot be set on objects within the Network File
System or they will result in the operation failing with <em>errno</em> set to
[ENOTSUP].</p>
<p>
The NFS client supports the QP0L_ATTR_SUID, QP0L_ATTR_SGID, and
QP0L_ATTR_RSTDRNMUNL attributes by passing them to the server over the
network and surfacing them to the caller. Whether a particular network
file system supports the setting of these attributes depends on the server.
Most servers have the capability of masking off the QP0L_ATTR_SUID and
QP0L_ATTR_SGID attributes if the NOSUID option is specified on the export.
The default, however, is to support these attributes.
</p>
</li>
<li>QNetWare File System Differences
<p>The QNetWare File System does not support setting the
QP0L_ATTR_RSTDRNMUNL,
QP0L_ATTR_SYSTEM_ARCHIVE,
QP0L_ATTR_RESET_DATE,
<img src="delta.gif" alt="Start of change">
QP0L_ATTR_CRTOBJAUD attributes.
<img src="deltaend.gif" alt="End of change">
If you set any attribute on a NetWare Directory
Services (NDS) object, the operation will fail with <em>errno</em> set to
[ENOTSUP].</p>
<p>
QNetWare supports the QP0L_ATTR_SUID and QP0L_ATTR_SGID attributes by passing them to the
server and surfacing them to the caller. Some versions of NetWare may support
the attributes and others may not.</p>
</li>
<li>QDLS File System Differences
<p>
The following attributes may be set on objects in this file system:</p>
<ul>
<li>QP0L_ATTR_ACCESS_TIME</li>
<li>QP0L_ATTR_CCSID</li>
<li>QP0L_ATTR_CODEPAGE</li>
<li>QP0L_ATTR_MODIFY_TIME</li>
<li>QP0L_ATTR_PC_ARCHIVE</li>
<li>QP0L_ATTR_PC_HIDDEN</li>
<li>QP0L_ATTR_PC_READ_ONLY</li>
<li>QP0L_ATTR_PC_SYSTEM</li>
<li>QP0L_ATTR_RESET_DATE (for documents only)</li>
</ul>
<p>Attempting to set any other than the QP0L_ATTR_SUID or QP0L_ATTR_SGID attributes
will result in the operation failing with <em>errno</em> set to [ENOTSUP].</p>
<p>
QDLS does not support setting the QP0L_ATTR_SUID or QP0L_ATTR_SGID
attributes. They will be ignored if specified.
</p></li>
<li>QOPT File System Differences
<p>If you set the QP0L_ALWSAV_YES value for the QP0L_ATTR_ALWSAV attribute, the
operation will fail with <em>errno</em> set to [ENOTSUP]. </p>
<p>
QOPT does not support setting the QP0L_ATTR_SUID, QP0L_ATTR_SGID,
QP0L_ATTR_RSTDRNMUNL,
<img src="delta.gif" alt="Start of change">
or QP0L_ATTR_CRTOBJAUD
<img src="deltaend.gif" alt="End of change">
attributes for any optical media format.
If any attribute is specified, the operation will fail with <em>errno</em> set to [ENOTSUP].
</p>
</li>
<li>
QFileSvr.400 File System Differences
<p>QFileSvr.400 supports the QP0L_ATTR_SUID, QP0L_ATTR_SGID,
and QP0L_ATTR_RSTDRNMUNL
attributes by passing them to the server and surfacing them to
the caller.</p>
<p>QFileSvr.400 does not support setting the QP0L_ATTR_ALWSAV attribute. The
operation will fail if this attribute is specified.</p>
<p><img src="delta.gif" alt="Start of change">
QFileSvr.400 supports setting the QP0L_ATTR_CRTOBJAUD attribute.
However, the QSECOFR user profiles on the source and target
system must be enabled, and their passwords must match
for the operation to succeed.
<img src="deltaend.gif" alt="End of change"></p>
</li>
<li>
QNTC File System Differences
<p><img src="delta.gif" alt="Start of change">
The following attributes may be set on objects in this file system:</p>
<ul>
<li>QP0L_ATTR_PC_ARCHIVE</li>
<li>QP0L_ATTR_PC_HIDDEN</li>
<li>QP0L_ATTR_PC_READ_ONLY</li>
<li>QP0L_ATTR_PC_SYSTEM</li>
</ul>
<p>Attempting to set any other than the QP0L_ATTR_SUID or QP0L_ATTR_SGID attributes
will result in the operation failing with <em>errno</em> set to [ENOTSUP].
<img src="deltaend.gif" alt="End of change"></p>
<p>QNTC does not support setting the QP0L_ATTR_SUID or
QP0L_ATTR_SGID attributes. They will be ignored if specified.</p>
</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>Qp0lstdi.h</strong>&gt; file (see <a href="unix13.htm">
Header Files for UNIX-Type Functions</a>)
</li>
<li>The &lt;<strong>qlg.h</strong>&gt; file (see <a href="unix13.htm">Header
Files for UNIX-Type Functions</a>)
</li>
<li><a href="chmod.htm">chmod()</a>--Change File Authorizations
</li>
<li><a href=
"ifscloseexit.htm">Integrated File System Scan on Close Exit Programs</a>
</li>
<li><a href=
"ifsopenexit.htm">Integrated File System Scan on Open Exit Programs</a>.
</li>
<li><a href="qsetattru.htm">QlgSetAttr()</a>--Set Attributes (using NLS-enabled
path name)
</li>
<li><a href="qgetattr.htm">Qp0lGetAttr()</a>--Get Attributes
</li>
<li><a href=
"qwcrsval.htm">Retrieve System Values (QWCRSVAL) API</a>
</li>
</ul>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following is an example showing a call to the <strong>
Qp0lSetAttr()</strong> and the <strong>Qp0lGetAttr()</strong> APIs.</p>
<pre>
/***************************************************************/
#include "Qp0lstdi.h"
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;sys/types.h&gt;
int GetAttrObject(
Qlg_Path_Name_T *Pathname_ptr,
char *Buffer_ptr,
unsigned int Buffer_size)
{
/**************************************************************/
/* Local variables */
/**************************************************************/
struct attrStruct
{
Qp0l_AttrTypes_List_t attr_struct;
uint AttrTypes[10];
};
struct attrStruct Attr_types_ptr;
unsigned int buff_size_needed;
unsigned int num_bytes_returned;
unsigned int follow_sym;
int rc;
/**************************************************************/
/* Start of executable code */
/**************************************************************/
/**************************************************************/
/* Initialize Get Attributes Parameters */
/**************************************************************/
memset((void *)&amp;Attr_types_ptr, 0x00,sizeof(struct attrStruct));
Attr_types_ptr.attr_struct.Number_Of_ReqAttrs = 3;
Attr_types_ptr.AttrTypes[0] = QP0L_ATTR_PC_READ_ONLY;
Attr_types_ptr.AttrTypes[1] = QP0L_ATTR_PC_HIDDEN;
Attr_types_ptr.AttrTypes[2] = QP0L_ATTR_CODEPAGE;
buff_size_needed = 0;
follow_sym = QP0L_FOLLOW_SYMLNK;
/**************************************************************/
/* Call Qp0lGetAttr() to retrieve attributes. */
/**************************************************************/
rc = Qp0lGetAttr(Pathname_ptr,
(Qp0l_AttrTypes_List_t *)&amp;Attr_types_ptr,
Buffer_ptr,
Buffer_size,
&amp;buff_size_needed,
&amp;num_bytes_returned,
follow_sym);
if((rc == 0) &amp;&amp; /* If successful, but */
(num_bytes_returned &lt;= 0)) /* Incorrect bytes returned */
rc = EUNKNOWN; /* Unknown error */
return(rc);
} /* End GetAttrObject() */
int SetAttrObject(
Qlg_Path_Name_T *Pathname_ptr,
char *Buffer_ptr,
unsigned int Buffer_size)
{
/**************************************************************/
/* Local variables */
/**************************************************************/
unsigned int follow_sym;
int rc;
int done = 0;
unsigned int attrSize;
Qp0l_Attr_Header_t *attrPtr;
/**************************************************************/
/* Start of executable code */
/**************************************************************/
/**************************************************************/
/* Initialize Set Attributes Parameters */
/**************************************************************/
follow_sym = QP0L_FOLLOW_SYMLNK;
/**************************************************************/
/* Qp0lSetAttr() only sets one attribute at a time. The */
/* buffer from Qp0lGetAttr may contain more than one */
/* attribute to set. We may have to call Qp0lSetAttr() */
/* multiple times. The Next_Attr_Offset value is the key. */
/* If it is greater than zero, then there is another */
/* attribute in the buffer. Also, it is important to note */
/* that the value stored there is the offset from the start */
/* of the buffer, not the offset from the start of the */
/* current entry. */
/**************************************************************/
attrPtr = (Qp0l_Attr_Header_t *)Buffer_ptr;
while(!done)
{
attrSize = attrPtr-&gt;Attr_Size +
sizeof(Qp0l_Attr_Header_t); /* Calculate attr size */
/*********************************************************/
/* Call Qp0lSetAttr() to set the attribute */
/*********************************************************/
rc=Qp0lSetAttr(Pathname_ptr,
(char *)attrPtr,
attrSize,
follow_sym);
if(rc != 0) /* If the function failed */
done = 1; /* End the loop */
else if(attrPtr-&gt;Next_Attr_Offset &gt; 0) /* If more data */
attrPtr = (Qp0l_Attr_Header_t *) /* Set attribute */
(Buffer_ptr + attrPtr-&gt;Next_Attr_Offset); /* pointer */
else /* No more data */
done = 1; /* End the loop */
}
return(rc);
} /* End SetAttrObject() */
int main (int argc, char *argv[])
{
#define MYPN "FRED"
#define MYPN2 "FRED2"
/**************************************************************/
/* Local variables */
/**************************************************************/
const char US_const[3] = "US";
const char Language_const[4] = "ENU";
const char Path_Name_Del_const[2] = "/";
typedef struct pnstruct
{
Qlg_Path_Name_T qlg_struct;
char pn[sizeof(MYPN)];
} ;
typedef struct pnstruct2
{
Qlg_Path_Name_T qlg_struct;
char pn[sizeof(MYPN2)];
} ;
struct pnstruct pns;
struct pnstruct2 pns2;
int rc;
char BufferArea[250];
unsigned int buffer_size = 250;
/**************************************************************/
/* Start of executable code */
/**************************************************************/
/**************************************************************/
/* Initialize Pathname for original object */
/**************************************************************/
memset((void *)&amp;pns, 0, sizeof(struct pnstruct));
pns.qlg_struct.CCSID = 37;
memcpy(pns.qlg_struct.Country_ID,US_const,2);
memcpy(pns.qlg_struct.Language_ID,Language_const,3);;
pns.qlg_struct.Path_Type = 0;
pns.qlg_struct.Path_Length = sizeof(MYPN) - 1;
memcpy(pns.qlg_struct.Path_Name_Delimiter,Path_Name_Del_const,1);
memcpy(pns.pn,MYPN,sizeof(MYPN));
/**************************************************************/
/* Call GetAttrObject to retrieve attributes from the source */
/* object. */
/**************************************************************/
rc = GetAttrObject((Qlg_Path_Name_T *)&amp;pns,
BufferArea,
buffer_size);
if (rc == 0) /* If GetAttr succeeded */
{
/************************************************************/
/* Initialize Pathname for target object */
/************************************************************/
memset((void *)&amp;pns2, 0, sizeof(struct pnstruct2));
pns2.qlg_struct.CCSID = 37;
memcpy(pns2.qlg_struct.Country_ID,US_const,2);
memcpy(pns2.qlg_struct.Language_ID,Language_const,3);;
pns2.qlg_struct.Path_Type = 0;
pns2.qlg_struct.Path_Length = sizeof(MYPN2)-1;
memcpy(pns2.qlg_struct.Path_Name_Delimiter,Path_Name_Del_const,1);
memcpy(pns2.pn,MYPN2,sizeof(MYPN2));
/************************************************************/
/* Call SetAttrObject to set attributes on the target */
/* object. */
/************************************************************/
rc=SetAttrObject((Qlg_Path_Name_T *)&amp;pns2,
BufferArea,
buffer_size);
if (rc != 0)
{
rc = errno; /* return errno from SetAttrObject */
printf("Qp0lSetAttr() for %s failed with %i.\n",pns2.pn,rc);
}
} /* end check GetAttrObject rc */
else /* GetAttrObject failed */
{
rc = errno; /* return errno from GetAttrObject */
printf("Qp0lGetAttr() for %s failed with %s.\n",pns.pn,rc);
}
return(rc);
} /* end main */
</pre>
<br>
<hr>
API introduced: V4R4
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by category</a></td>
</tr>
</table>
</center>
</body>
</html>