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

1041 lines
29 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>ioctl()--Perform I/O Control Request</title>
<!-- Begin Header Records ========================================= -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- file cleaned -->
<!-- Unix2 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Change History: -->
<!-- 010703 JTROUS Add ERESTART, EINTR, V5R2, DCR 98686 -->
<!-- 011022 JTROUS Changes from API Review 1, V5R2 -->
<!-- IFS and Sockets versions merged for V5R2 -->
<!-- Edited by Kersten Feb 02 -->
<!-- 0206?? JET This file has undergone html cleanup -->
<!-- 020618 EMIG: updated for NFS threadsafety, V5R3 -->
<!-- 020718 MFENLON: updated for QFileSvr.400 threadsafety, V5R3 -->
<!-- 050329 JTROUS: fix enums, no change flag, V5R4 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- End Header Records -->
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>ioctl()--Perform I/O Control Request</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;sys/ioctl.h&gt;
int ioctl(int <em>descriptor</em>,
unsigned long <em>request</em>,
...);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QP0LLIB1<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Conditional; see <a href="#unotes">Usage
Notes</a>.&nbsp;<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>ioctl()</strong> function performs control functions (requests)
on a descriptor.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>descriptor</strong></dt>
<dd>(Input) The descriptor on which the control request is to be performed.<br>
<br>
</dd>
<dt><strong>request</strong></dt>
<dd>(Input) The request that is to be performed on the <em>descriptor</em>.<br>
<br>
</dd>
<dt><strong>...</strong></dt>
<dd>(Input) A variable number of optional parameters that are dependent on the
request.</dd>
</dl>
<p>The <em>ioctl()</em> requests that are supported are:</p>
<table cellpadding="5">
<!-- cols="20 80" -->
<tr>
<td align="left" valign="top"><em>FIOASYNC</em></td>
<td align="left" valign="top">Set or clear the flag that allows the receipt of
asynchronous I/O signals (<samp>SIGIO</samp>).
<p>The third parameter represents a pointer to an integer flag. A nonzero value
sets the socket to generate <samp>SIGIO</samp> signals, while a zero value sets
the socket to not generate <samp>SIGIO</samp> signals. Note that before the
<samp>SIGIO</samp> signals can be delivered, you must use either the <samp>
FIOSETOWN</samp> or <samp>SIOCSPGRP</samp> <em>ioctl()</em> request, or the
<samp>F_SETOWN</samp> <em>fcntl()</em> command to set a process ID or a process
group ID to indicate what process or group of processes will receive the
signal. Once conditioned to send <samp>SIGIO</samp> signals, a socket will
generate <samp>SIGIO</samp> signals whenever certain significant conditions
change on the socket. For example, <samp>SIGIO</samp> will be generated when
normal data arrives on the socket, when out-of-band data arrives on the socket
(in addition to the <samp>SIGURG</samp> signal), when an error occurs on the
socket, or when end-of-file is received on the socket. It is also generated
when a connection request is received on the socket (if it is a socket on which
the <em>listen()</em> verb has been done). Also note that a socket can be set
to generate the <samp>SIGIO</samp> signal by using the <em>fcntl()</em> command
<samp>F_SETFL</samp> with a flag value specifying <samp>FASYNC</samp>.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>FIOCCSID</em></td>
<td align="left" valign="top">Return the coded character set ID (CCSID)
associated with the open instance represented by the descriptor and the CCSID
associated with the object. The third parameter represents a pointer to the
structure Qp0lFIOCCSID, which is defined in &lt;sys/ioctl.h&gt;. This
information may be necessary to correctly manipulate data read from or written
to a file opened in another process.
<p>If the open instance represented by the descriptor is in binary mode (the
open() did not specify the O_TEXTDATA open flag), the open instance CCSID
returned is equal to the object CCSID returned.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><a name="fiogetown"><em>FIOGETOWN</em></a></td>
<td align="left" valign="top">Get the process ID or process group ID that is to
receive the <samp>SIGIO</samp> and <samp>SIGURG</samp> signals.
<p>The third parameter represents a pointer to a signed integer that will
contain the process ID or the process group ID to which the socket is currently
sending asynchronous signals such as <samp>SIGURG</samp>. A process ID is
returned as a positive integer, and a process group ID is specified as a
negative integer. A 0 value returned indicates that no asynchronous signals can
be generated by the socket. A positive or a negative value indicates that the
socket has been set to generate <samp>SIGURG</samp> signals.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>FIONBIO</em></td>
<td align="left" valign="top">Set or clear the nonblocking I/O flag (O_NONBLOCK
oflag). The third parameter represents a pointer to an integer flag. A nonzero
value sets the nonblocking I/O flag for the descriptor; a zero value clears the
flag.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>FIONREAD</em></td>
<td align="left" valign="top">Return the number of bytes available to be read.
The third parameter represents a pointer to an integer that is set to the
number of bytes available to be read.<br>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><a name="fiosetown"><em>FIOSETOWN</em></a></td>
<td align="left" valign="top">Set the process ID or process group ID that is to
receive the <samp>SIGIO</samp> and <samp>SIGURG</samp> signals.
<p>The third parameter represents a pointer to a signed integer that contains
the process ID or the process group ID to which the socket should send
asynchronous signals such as <samp>SIGURG</samp>. A process ID is specified as
a positive integer, and a process group ID is specified as a negative integer.
Specifying a 0 value resets the socket such that no asynchronous signals are
delivered. Specifying a process ID or a process group ID requests that sockets
begin sending the <samp>SIGURG</samp> signal to the specified ID when
out-of-band data arrives on the socket.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><a name="siocaddrt"><em>SIOCADDRT</em></a></td>
<td align="left" valign="top">Add an entry to the interface routing table.
Valid for sockets with address family of <samp>AF_INET</samp>.
<p>The third parameter represents a pointer to the structure <strong>
rtentry</strong>, which is defined in <strong>&lt;net/route.h&gt;</strong>:</p>
<pre>
struct rtentry [
struct sockaddr rt_dst;
struct sockaddr rt_mask;
struct sockaddr rt_gateway;
int rt_mtu;
u_short rt_flags;
u_short rt_refcnt;
u_char rt_protocol;
u_char rt_TOS;
char rt_if[IFNAMSIZ];
];
</pre>
<p>The <em>rt_dst</em>, <em>rt_mask</em>, and <em>rt_gateway</em> fields are
the route destination address, route address mask, and gateway address,
respectively. <em>rt_mtu</em> is the maximum transfer unit associated with the
route. <em>rt_flags</em> contains flags that give some information about a
route (for example, whether the route was created dynamically, whether the
route is usable, type of route, and so on). <em>rt_refcnt</em> indicates the
number of references that exist to the route entry. <em>rt_protocol</em>
indicates how the route entry was generated (for example, configuration, ICMP
redirect, and so on). <em>rt_tos</em> is the type of service associated with
the route. <em>rt_if</em> is a NULL-terminated string that represents the
interface IP address in dotted decimal format that is associated with the
route.</p>
<p>To add a route, the following fields must be set:</p>
<ul>
<li><em>rt_dst</em></li>
<li><em>rt_mask</em></li>
<li><em>rt_gateway</em></li>
<li><em>rt_tos</em></li>
<li><em>rt_protocol</em></li>
<li><em>rt_mtu</em> (Setting the <em>rt_mtu</em> value to zero essentially
means use the MTU from the associated line description used when the route is
bound to an IFC.)</li>
<li><em>rt_if</em> (<em>rt_if</em> can be set to the dotted decimal equivalent
of <samp>INADDR_ANY</samp>, which is 0.)</li>
</ul>
<p>In addition, the <em>rt_flags</em> bit flags can be set to the
following:</p>
<ul>
<li>RTF_NOREBIND_IFC_FAIL if no rebinding of the route is to occur when the
interface associated with the route fails.</li>
<li>RTF_NOREBIND_IFC_ACTV if no rebinding is to occur when interfaces are
activated or deactivated.</li>
</ul>
<p>To delete a route, the following fields must be set:</p>
<ul>
<li><em>rt_dst</em></li>
<li><em>rt_mask</em></li>
<li><em>rt_gateway</em></li>
<li><em>rt_tos</em></li>
<li><em>rt_protocol</em></li>
</ul>
<p>All other fields are ignored when adding or removing an entry.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCATMARK</em></td>
<td align="left" valign="top">Return the value indicating whether socket's read
pointer is currently at the out-of-band mark.
<p>The third parameter represents a pointer to an integer flag. If the socket's
read pointer is currently at the out-of-band mark, the flag is set to a nonzero
value. If it is not, the flag is set to zero.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCDELRT</em></td>
<td align="left" valign="top">Delete an entry from the interface routing table.
Valid for sockets with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocaddrt"><em>SIOCADDRT</em></a> for more information on the
third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><a name="siocgifaddr"><em>
SIOCGIFADDR</em></a></td>
<td align="left" valign="top">Get the interface address. Valid for sockets with
address family of <samp>AF_INET</samp>.
<p>The third parameter represents a pointer to the structure <strong>
ifreq</strong>, defined in <strong>&lt;net/if.h&gt;</strong>:</p>
<pre>
struct ifreq {
char ifr_name[IFNAMSIZE];
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_mask;
struct sockaddr ifru_broadaddr;
short ifru_flags;
int ifru_mtu;
int infu_rbufsize;
char ifru_linename[10];
char ifru_TOS;
} ifr_ifru;
};
</pre>
<p><em>ifr_name</em> is the name of the interface for which information is to
be retrieved. The i5/OS implementation requires this field to be set to a
NULL-terminated string that represents the interface IP address in dotted
decimal format. Depending on the request, one of the fields in the <em>
ifr_ifru</em> union will be set upon return from the <em>ioctl()</em> call.
<em>ifru_addr</em> is the local IP address of the interface. <em>ifru_mask</em>
is the subnetwork mask associated with the interface. <em>ifru_broadaddr</em>
is the broadcast address. <em>ifru_flags</em> contains flags that give some
information about an interface (for example, token-ring routing support,
whether interface is active, broadcast address, and so on). <em>ifru_mtu</em>
is the maximum transfer unit configured for the interface. <em>
ifru_rbufsize</em> is the reassembly buffer size of the interface. <em>
ifru_linename</em> is the line name associated with the interface. <em>
ifru_TOS</em> is the type of service configured for the interface.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFBRDADDR</em></td>
<td align="left" valign="top">Get the interface broadcast address. Valid for
sockets with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFCONF</em></td>
<td align="left" valign="top">Get the interface configuration list. Valid for
sockets with address family of <samp>AF_INET</samp>.
<p>The third parameter represents a pointer to the structure <strong>
ifconf</strong>, defined in <strong>&lt;net/if.h&gt;</strong>:</p>
<pre>
struct ifconf [
int ifc_len;
int ifc_configured;
int ifc_returned;
union {
caddr_t ifcu_buf;
struct ifreq *ifcu_req;
} ifc_ifcu;
];
</pre>
<p><em>ifc_len</em> is a value-result field. The caller passes the size of the
buffer pointed to by <em>ifcu_buf</em>. On return, <em>ifc_len</em> contains
the amount of storage that was used in the buffer pointed to by <em>
ifcu_buf</em> for the interface entries. <em>ifc_configured</em> is the number
of interface entries in the interface list. <em>ifc_returned</em> is the number
of interface entries that were returned (this is dependent on the size of the
buffer pointed to by <em>ifcu_buf</em>). <em>ifcu_buf</em> is the user buffer
in which a list of interface entries will be stored. Each stored entry will be
an <em>ifreq</em> structure.</p>
<p>To get the interface configuration list, the following fields must be
set:</p>
<ul>
<li><em>ifc_len</em></li>
<li><em>ifcu_buf</em><br>
<br>
</li>
</ul>
<p>See <a href="#siocgifaddr">SIOCGIFADDR</a> for more information on the list
of <em>ifreq</em> structures returned. For this request, the <em>ifr_name</em>
and <em>ifru_addr</em> fields will be set to a value.</p>
<p><strong>Note:</strong> Additional information about each individual
interface can be obtained using these values and the other interface-related
requests.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFFLAGS</em></td>
<td align="left" valign="top">Get interface flags. Valid for sockets with
address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFLIND</em></td>
<td align="left" valign="top">Get the interface line description name. Valid
for sockets with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFMTU</em></td>
<td align="left" valign="top">Get the interface network MTU. Valid for sockets
with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFNETMASK</em></td>
<td align="left" valign="top">Get the mask for the network portion of the
interface address. Valid for sockets with address family of <samp>
AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFRBUFS</em></td>
<td align="left" valign="top">Get the interface reassembly buffer size. Valid
for sockets with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGIFTOS</em></td>
<td align="left" valign="top">Get the interface type-of-service (TOS). Valid
for sockets with address family of <samp>AF_INET</samp>.
<p>See <a href="#siocgifaddr"><em>SIOCGIFADDR</em></a> for more information on
the third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGPGRP</em></td>
<td align="left" valign="top">Get the process ID or process group ID that is to
receive the <samp>SIGIO</samp> and <samp>SIGURG</samp> signals.
<p>See <a href="#fiogetown"><em>FIOGETOWN</em></a> for more information on the
third parameter.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCGRTCONF</em></td>
<td align="left" valign="top">Get the route configuration list. Valid for
sockets with address family of <samp>AF_INET</samp>.
<p>For the <samp>SIOCGRTCONF</samp> request, the third parameter represents a
pointer to the structure <strong>rtconf</strong>, also defined in <strong>
&lt;net/route.h&gt;</strong>:</p>
<pre>
struct rtconf [
int rtc_len;
int rtc_configured;
int rtc_returned;
union {
caddr_t rtcu_buf;
struct rtentry *rtcu_req;
} rtc_rtcu;
];
</pre>
<p><em>rtc_len</em> is a value-result field. The caller passes the size of the
buffer pointed to by <em>rtcu_buf</em>. On return, <em>rtc_len</em> contains
the amount of storage that was used in the buffer pointed to by <em>
rtcu_buf</em> for the route entries. <em>rtc_configured</em> is the number of
route entries in the route list. <em>rtc_returned</em> is the number of route
entries that were returned (this is dependent on the size of the buffer pointed
to by <em>rtcu_buf</em>). <em>rtcu_buf</em> is the user buffer in which a list
of route entries will be stored. Each stored entry will be an <em>rtentry</em>
structure.</p>
<p>To get the route configuration list, the following fields must be set:</p>
<ul>
<li><em>rtc_len</em></li>
<li><em>rtcu_buf</em><br>
<br>
</li>
</ul>
<p>See <a href="#siocaddrt">SIOCADDRT</a> for more information on the list of
<em>rtentry</em> structures returned. For this request, all fields in each <em>
rtentry</em> structure will be set to a value.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCSENDQ</em></td>
<td align="left" valign="top">Return the number of bytes on the send queue that
have not been acknowledged by the remote system. Valid for sockets with address
family of <samp>AF_INET</samp> or <samp>AF_INET6</samp> and socket type of
<samp>SOCK_STREAM</samp>.
<p>The third parameter represents a pointer to an integer that is set to the
number of bytes yet to be acknowledged as being received by the remote TCP
transport driver.</p>
<p><strong>Notes:</strong></p>
<ol>
<li>SIOCSENDQ is used after a series of blocking or non-blocking send
operations to see if the sent data has reached the transport layer on the
remote system. Note that this does not not guarantee the data has reached the
remote application.<br>
<br>
</li>
<li>When SIOCSENDQ is used in a multithreaded application, the actions of other
threads must be considered by the application. SIOCSENDQ provides a result for
a socket descriptor at the given point in time when the <em>ioctl()</em>)
request is received by the TCP transport layer. Blocking send operations that
have not completed, as well as non-blocking send operations in other threads
issued after the SIOCSENDQ <em>ioctl()</em>, are not reflected in the result
obtained for the SIOCSENDQ <em>ioctl()</em>.<br>
<br>
</li>
<li>In a situation where the application has multiple threads sending data on
the same socket descriptor, the application should not assume that all data has
been received by the remote side when 0 is returned if the application is not
positive that all send operations in the other threads were complete at the
time the SIOCSENDQ <em>ioctl()</em> was issued. An application should issue the
SIOCSENDQ <em>ioctl()</em> only after it has completed all of the send
operations. No value is added by querying the machine to see if it has sent all
of the data when the application itself has not sent all of the data in a given
unit of work.</li>
</ol>
<br>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>SIOCSPGRP</em></td>
<td align="left" valign="top">Set the process ID or process group ID that is to
receive the <samp>SIGIO</samp> and <samp>SIGURG</samp> signals.
<p>See <a href="#fiosetown"><em>FIOSETOWN</em></a> for more information on the
third parameter.</p>
</td>
</tr>
</table>
<br>
<h3>Authorities</h3>
<p>No authorization is required.</p>
<br>
<h3>Return Value</h3>
<dl compact>
<dt><em>0</em></dt>
<dd><strong>ioctl()</strong> was successful</dd>
<dt><em>-1</em></dt>
<dd><strong>ioctl()</strong> was not successful. The <em>
errno</em> global variable is set to indicate the error.</dd>
</dl>
<br>
<h3>Error Conditions</h3>
<p>If <strong>ioctl()</strong> is not successful, <em>errno</em> usually
indicates one of the following errors. Under some conditions, <em>errno</em>
could indicate an error other than those listed here.</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#EBADF">EBADF</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#EBUSY">EBUSY</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#ENOBUFS">ENOBUFS</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#ENOSYS">ENOSYS</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#ENOTSAFE">ENOTSAFE</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#EPIPE">EPIPE</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
<tr>
<td align="left" valign="top">
<em>[<a href="unix14.htm#ERESTART">ERESTART</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#EUNATCH">EUNATCH</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</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>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#ETIMEDOUT">ETIMEDOUT</a>]</em></td>
<td align="left" valign="top">
&nbsp;
</td>
</tr>
</table>
<br>
<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">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td valign="top" width="15%">CPFA0D4 E</td>
<td valign="top" width="85%">File system error occurred. Error number
&amp;1.</td>
</tr>
<tr>
<td align="left" valign="top">CPFA081 E</td>
<td align="left" valign="top">Unable to set return value or error code.</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">CPE3418 E</td>
<td align="left" valign="top">Possible APAR condition or hardware failure.</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>
</table>
<br>
<br>
<h3><a name="unotes">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.</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:<br>
<br>
<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>QDLS File System Differences
<p>QDLS does not support <strong>ioctl()</strong>.</p>
</li>
<li>QOPT File System Differences
<p>QOPT does not support <strong>ioctl()</strong>.</p>
</li>
<li>A program must have the appropriate privilege <samp>*IOSYSCFG</samp> to
issue any of the following requests: <samp>SIOCADDRT</samp> and <samp>
SIOCDELRT</samp>.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>sys/ioctl.h</strong>&gt; file (see <a href="unix13.htm">
Header Files for UNIX-Type Functions</a>)
</li>
<li>The &lt;<strong>sys/types.h</strong>&gt; file (see <a href="unix13.htm">
Header Files for UNIX-Type Functions</a>)
</li>
<li><a href="fcntl.htm">fcntl()</a>--Perform File Control Command
</li>
<li><a href="../rzab6/rzab6soxoverview.htm">Socket Programming</a></li>
</ul>
<hr>
API introduced: V3R1
<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>