215 lines
5.1 KiB
HTML
215 lines
5.1 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>getdomainname()--Retrieve Domain Name</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: -->
|
|
<!-- Unix8 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
|
<!-- Edited by Kersten Feb 02 -->
|
|
<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>getdomainname()--Retrieve Domain Name</h2>
|
|
|
|
<div class="box" style="width: 60%;">
|
|
<br>
|
|
Syntax<br>
|
|
<pre>
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
|
|
int getdomainname(char *<em>name</em>,
|
|
int <em>length</em>)
|
|
</pre>
|
|
|
|
<br>
|
|
Service Program Name: QSOSRV1<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Yes<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The <em>getdomainname()</em> function is used to retrieve the name of the
|
|
domain from the system.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>name</strong></dt>
|
|
|
|
<dd>(Output) The <strong>name</strong> parameter can be one of the following:
|
|
|
|
<ul>
|
|
<li>The pointer to a character array where the domain name is to be stored. The
|
|
domain name is NULL-terminated unless the length of the domain name exceeds the
|
|
length of the <em>name</em> parameter. In that case the domain name is
|
|
truncated to the size of the <em>name</em> parameter.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>A NULL string when a <em>sethostname()</em> has not been previously issued
|
|
since the last initial program load.</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>length</strong></dt>
|
|
|
|
<dd>(Input) The length of the <em>name</em> parameter. Maximum length of domain
|
|
names is 255.</dd>
|
|
</dl>
|
|
|
|
<br>
|
|
<h3>Authorities</h3>
|
|
|
|
<p>None.</p>
|
|
|
|
<br>
|
|
<h3>Return Value</h3>
|
|
|
|
<p><em>getdomainname()</em> returns an integer. Possible values are:</p>
|
|
|
|
<ul>
|
|
<li>-1 (unsuccessful)<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>0 (successful)</li>
|
|
</ul>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Error Conditions</h3>
|
|
|
|
<p>When <em>getdomainname()</em> fails, <em>errno</em> can be set to one of the
|
|
following:</p>
|
|
|
|
<table cellpadding="5">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<td align="left" valign="top"><em>[EFAULT]</em></td>
|
|
<td align="left" valign="top">Bad address.
|
|
|
|
<p>The system detected an address which was not valid while attempting to
|
|
access the <em>name</em> parameter.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>[EINVAL]</em></td>
|
|
<td align="left" valign="top">Parameter not valid.
|
|
|
|
<p>The <em>length</em> parameter specifies a negative value.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>[EIO]</em></td>
|
|
<td align="left" valign="top">Input/output error.<br><br></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>[EUNKNOWN]</em></td>
|
|
<td align="left" valign="top">Unknown system state.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<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 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 &1 in library
|
|
&2 ended. Reason code &3.</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>
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
|
|
|
|
<h3>Usage Notes</h3>
|
|
|
|
<ol>
|
|
<li>When a process issues a <em>setdomainname()</em>, the name of the domain
|
|
can be accessed by any process that issues a <em>getdomainname()</em>.<br>
|
|
<br>
|
|
</li>
|
|
|
|
<li>The name of the domain is reset to NULL when an initial program load is
|
|
performed.
|
|
|
|
<p><strong>Note:</strong> The domain name returned by this function is NOT related to the
|
|
domain name of the domain name server that is configured using the Configure
|
|
TCP/IP (CFGTCP) menu.</p>
|
|
</li>
|
|
|
|
<li>The domain name is returned in the default coded character set identifier
|
|
(CCSID) currently in effect for the job.</li>
|
|
</ol>
|
|
|
|
<br>
|
|
<h3>Related Information</h3>
|
|
|
|
<ul>
|
|
<li><a href="sdomn.htm">setdomainname()</a>--Set Domain Name</li>
|
|
</ul>
|
|
|
|
<br>
|
|
<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>
|
|
|