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

347 lines
8.9 KiB
HTML

<!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>getnetconfigent()--Return a Pointer to a Netconfig Structure</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: -->
<!-- RPCMST SCRIPT A converted by B2H R4.1 (346) (CMS) by PMHALL at -->
<!-- RCHVMW2 on 7 Oct 1998 at 23:43:14 -->
<!-- Edited by Kersten Feb 02 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--End Header Records -->
<!-- Java sync-link -->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<a name="Top_Of_Page"></a>
<h2>getnetconfigent()--Return a Pointer to a Netconfig Structure</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;netconfig.h&gt;
struct netconfig *getnetconfigent(char *);
</pre>
<br>
&nbsp;&nbsp;Service Program Name: QZNFTRPC<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: No<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>getnetconfigent()</strong> function returns the pointer to the
netconfig structure that corresponds to the input netid.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>netid</strong> &nbsp;(Input)&nbsp;</dt>
<dd>A character pointer to a netid such as &quot;tcp&quot; or &quot;udp&quot;.</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>The caller of <strong>getnetconfigent()</strong> function must have execute
(*X) authority to the <strong>/etc</strong> directory and must have read (*R)
authority to the <strong>netconfig</strong> file.</p>
<br>
<h3>Return Value</h3>
<table cellpadding="5">
<!-- cols="15 85" -->
<tr>
<td align="left" valign="top"><em>netconfig</em></td>
<td align="left" valign="top"><strong>getnetconfigent()</strong> was
successful. A pointer to a netconfig structure is returned.</td>
</tr>
<tr>
<td align="left" valign="top"><em>NULL</em></td>
<td align="left" valign="top"><strong>getnetconfigent()</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 <strong>getnetconfigent()</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="15 85" -->
<tr>
<td align="left" valign="top"><em>[EACCES]</em></td>
<td align="left" valign="top">Permission denied.
<ul>
<li>An attempt was made to access an object in a way forbidden by its object
access permissions.</li>
<li>The job does not have access to the specified file, directory, component,
or path.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EAGAIN]</em></td>
<td align="left" valign="top">Operation would have caused the process to be
suspended.</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EBADNAME]</em></td>
<td align="left" valign="top">The object name specified is not correct.</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EBUSY]</em></td>
<td align="left" valign="top">Resource busy.</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ECONVERT]</em></td>
<td align="left" valign="top">Conversion error.
<ul>
<li>One or more characters could not be converted from the source CCSID to the
target CCSID.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EDAMAGE]</em></td>
<td align="left" valign="top">A damaged object was encountered.
<ul>
<li>A referenced object is damaged. The object cannot be used.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EIO]</em></td>
<td align="left" valign="top">Input/output error.
<ul>
<li>A physical I/O error occurred. A reference object may be damaged.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EMFILE]</em></td>
<td align="left" valign="top">Too many open files for this process.
<ul>
<li>An attempt was made to open more files than allowed by the value OPEN_MAX.
The value of OPEN_MAX can be retrieved using the <strong>sysconf()</strong>
function.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENFILE]</em></td>
<td align="left" valign="top">Too many open files in the system.
<ul>
<li>A system limit has been reached for the number of files that are allowed to
be concurrently open in the system.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOENT]</em></td>
<td align="left" valign="top">No such path or directory.
<ul>
<li>The directory or a component of the path name specified does not
exist.</li>
<li>A named file or directory does not exist or is an empty string.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOMEM]</em></td>
<td align="left" valign="top">Storage allocation request failed.
<ul>
<li>The function needed to allocate storage, but no storage is available.</li>
<li>There is not enough memory to perform the requested function.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOSPC]</em></td>
<td align="left" valign="top">No space available.
<ul>
<li>The requested operations required additional space on the device and there
is no space left. This could also be caused by exceeding the user profile
storage limit when creating or transferring ownership of an object.
<ul>
<li>Insufficient space remains to hold the intended file.</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[ENOSYSRSC]</em></td>
<td align="left" valign="top">System resources not available to complete the
request.</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EPERM]</em></td>
<td align="left" valign="top">Operation not permitted.
<ul>
<li>You must have appropriate privileges or other resources to do the requested
operation.</li>
</ul>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>[EUNKNOWN]</em></td>
<td align="left" valign="top">Unknown system state.
<ul>
<li>The operation failed because of an unknown system state. See any messages
in the job log and correct any errors that are indicated. Then retry the
operation.</li>
</ul>
</td>
</tr>
</table>
<br>
<h3>Error Messages</h3>
<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 width="15%" valign="top">CPE3418 E</td>
<td width="85%" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
<tr>
<td align="left" valign="top">CPFA0D4 E</td>
<td align="left" valign="top">File system error occurred.</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">CPIA1C0 I</td>
<td align="left" valign="top">The file /etc/netconfig cannot be opened by
readers because another job has it open with write authority.</td>
</tr>
</table>
<br>
<br>
<h3>Usage Notes</h3>
<p><strong>getnetconfigent()</strong> returns a pointer to a netconfig
structure in the netconfig file for the corresponding netid. The netid is
expected in the job CCSID. It returns NULL if it is unsuccessful.</p>
<p>The callers of the <strong>getnetconfigent()</strong> function do not need
to call the <strong>setnetconfig()</strong> function prior to calling the
<strong>getnetconfigent()</strong> function but must call the
<strong>freenetconfigent()</strong> function to free the storage allocated by
the <strong>getnetconfigent()</strong> function.</p>
<p>The <strong>getnetconfigent()</strong> function will return [ENOENT] if the
/etc/netconfig file does not exist. The <strong>getnetconfigent()</strong>
function will fail with [ECONVERT] if the data conversion required to convert
the data stored in the /etc/netconfig file cannot be converted to the job
CCSID.</p>
<br>
<h3>Example</h3>
<p>For more information, see the example for <a href=
"freenet_configent.htm">freenetconfigent()--Free the Netconfig
Structure</a>.</p>
<br>
<hr>
API introduced: V4R2
<hr>
<table cellpadding="2" cellspacing="2" align="center">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"rpc1.htm">Remote Procedure Call (RPC) APIs</a> | <a href="aplist.htm">APIs by
category</a></td>
</tr>
</table>
</body>
</html>