ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzab6_5.4.0.1/cafunix.htm

113 lines
6.1 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="AF_UNIX address family" />
<meta name="abstract" content="This address family provides interprocess communications on the same system that uses the socket APIs. The address is really a path name to an entry in the file system." />
<meta name="description" content="This address family provides interprocess communications on the same system that uses the socket APIs. The address is really a path name to an entry in the file system." />
<meta name="DC.Relation" scheme="URI" content="address.htm" />
<meta name="DC.Relation" scheme="URI" content="uafunix.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/unlink.htm" />
<meta name="DC.Relation" scheme="URI" content="cafunixccsid.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="cafunix" />
<meta name="DC.Language" content="en-us" />
<!-- 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>AF_UNIX address family</title>
</head>
<body id="cafunix"><a name="cafunix"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">AF_UNIX address family</h1>
<div><p>This address family provides interprocess communications on the
same system that uses the socket APIs. The address is really a path name to
an entry in the file system.</p>
<div class="section"><p>You can create sockets in the root directory or any open file
system but file systems such as QSYS or QDOC. The program must bind an AF_UNIX,
SOCK_DGRAM socket to a name to receive any datagrams back. In addition, the
program must explicitly remove the file system object with the <span class="apiname">unlink()</span> API
when the socket is closed. </p>
</div>
<div class="section"><p>Sockets with the address family AF_UNIX use the sockaddr_un
address structure. This address structure changes if you use _XOPEN_SOURCE
macro to implement BSD 4.4/ UNIX<sup>®</sup> 98 specifications. For the sockaddr_un
address structure, these differences are summarized in the table:</p>
</div>
<div class="section"><div class="p">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 1. Differences between BSD 4.3 and BSD 4.4/ UNIX 98 for sockaddr_un
address structure</caption><thead align="left"><tr><th valign="top" id="d0e44">BSD 4.3 sockaddr_un address structure</th>
<th valign="top" id="d0e46">BSD 4.4/ UNIX 98 sockaddr_un address structure</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e44 "> <pre>struct sockaddr_un {
short sun_family;
char sun_path[126];
}; </pre>
</td>
<td valign="top" headers="d0e46 "> <pre>struct sockaddr_un {
uint8_t sun_len;
sa_family_t sun_family;
char sun_path[126];
};</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section"><div class="p">
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption>Table 2. AF_UNIX address structure </caption><thead align="left"><tr><th valign="top" id="d0e72">Address structure field</th>
<th valign="top" id="d0e74">Definition</th>
</tr>
</thead>
<tbody><tr><td valign="top" headers="d0e72 ">sun_len</td>
<td valign="top" headers="d0e74 ">This field contains the length of the address for UNIX 98
specifications. <div class="note"><span class="notetitle">Note:</span> The: sun_len field is only provided for BSD 4.4 compatibility.
It is not necessary to use this field even when using BSD 4.4/ UNIX 98 compatibility.
The field is ignored on input addresses.</div>
</td>
</tr>
<tr><td valign="top" headers="d0e72 ">sun_family</td>
<td valign="top" headers="d0e74 ">This field contains the address family.</td>
</tr>
<tr><td valign="top" headers="d0e72 ">sun_path</td>
<td valign="top" headers="d0e74 ">This field contains the path name to an entry in the
file system.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section"><p>For AF_UNIX address family, protocol specifications do not apply
because protocol standards are not involved. The communications mechanism
the two processes use is specific to the machine.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="address.htm" title="The address family parameter on a socket() determines the format of the address structure to use on socket functions.">Socket address family</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="uafunix.htm" title="The AF_UNIX address family (sockets using the AF_UNIX or AF_UNIX_CCSID address families) can be connection-oriented (type SOCK_STREAM) or they can be connectionless (type SOCK_DGRAM).">Use AF_UNIX address family</a></div>
<div><a href="cafunixccsid.htm" title="The AF_UNIX_CCSID family is compatible with the AF_UNIX address family and has the same limitations.">AF_UNIX_CCSID address family</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../apis/unlink.htm">unlink()</a></div>
</div>
</div>
</body>
</html>