BSD 4_4_Lite2 release
[unix-history] / usr / src / share / doc / psd / 21.ipc / 2.t
index 1b565bc..217d7c7 100644 (file)
@@ -1,32 +1,51 @@
-.\" Copyright (c) 1986 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1986, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\"
-.\" Redistribution and use in source and binary forms are permitted
-.\" provided that the above copyright notice and this paragraph are
-.\" duplicated in all such forms and that any documentation,
-.\" advertising materials, and other materials related to such
-.\" distribution and use acknowledge that the software was developed
-.\" by the University of California, Berkeley.  The name of the
-.\" University may not be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"    This product includes software developed by the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
 .\"
 .\"
-.\"    @(#)2.t 1.4 (Berkeley) %G%
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"    @(#)2.t 8.2 (Berkeley) 6/1/94
 .\"
 .\".ds RH "Basics
 .\"
 .\".ds RH "Basics
-.bp
 .nr H1 2
 .nr H2 0
 .nr H1 2
 .nr H2 0
-.bp
+.\" The next line is a major hack to get around internal changes in the groff
+.\" implementation of .NH.
+.nr nh*hl 1
 .LG
 .LG
+.sp 2
 .B
 .ce
 2. BASICS
 .sp 2
 .R
 .NL
 .B
 .ce
 2. BASICS
 .sp 2
 .R
 .NL
+.pl -1
 .PP
 The basic building block for communication is the \fIsocket\fP.
 A socket is an endpoint of communication to which a name may
 .PP
 The basic building block for communication is the \fIsocket\fP.
 A socket is an endpoint of communication to which a name may
@@ -44,19 +63,20 @@ exchange data only with
 sockets in the same domain (it may be possible to cross domain
 boundaries, but only if some translation process is
 performed).  The
 sockets in the same domain (it may be possible to cross domain
 boundaries, but only if some translation process is
 performed).  The
-4.3BSD IPC facilities support three separate communication domains:
+4.4BSD IPC facilities support four separate communication domains:
 the UNIX domain, for on-system communication;
 the Internet domain, which is used by
 processes which communicate
 the UNIX domain, for on-system communication;
 the Internet domain, which is used by
 processes which communicate
-using the the DARPA standard communication protocols;
-and the NS domain, which is used by processes which
+using the Internet standard communication protocols;
+the NS domain, which is used by processes which
 communicate using the Xerox standard communication
 communicate using the Xerox standard communication
-protocols*.
+protocols*;
 .FS
 * See \fIInternet Transport Protocols\fP, Xerox System Integration
 Standard (XSIS)028112 for more information.  This document is
 almost a necessity for one trying to write NS applications.
 .FE
 .FS
 * See \fIInternet Transport Protocols\fP, Xerox System Integration
 Standard (XSIS)028112 for more information.  This document is
 almost a necessity for one trying to write NS applications.
 .FE
+and the ISO OSI protocols, which are not documented in this tutorial.
 The underlying communication
 facilities provided by these domains have a significant influence
 on the internal system implementation as well as the interface to
 The underlying communication
 facilities provided by these domains have a significant influence
 on the internal system implementation as well as the interface to
@@ -133,6 +153,7 @@ simulated at the user level.  More information on this topic
 can be found in section 5.
 .NH 2
 Socket creation
 can be found in section 5.
 .NH 2
 Socket creation
+.pl -1
 .PP
 To create a socket the \fIsocket\fP system call is used:
 .DS
 .PP
 To create a socket the \fIsocket\fP system call is used:
 .DS
@@ -249,11 +270,11 @@ struct sockaddr_un addr;
 strcpy(addr.sun_path, "/tmp/foo");
 addr.sun_family = AF_UNIX;
 bind(s, (struct sockaddr *) &addr, strlen(addr.sun_path) +
 strcpy(addr.sun_path, "/tmp/foo");
 addr.sun_family = AF_UNIX;
 bind(s, (struct sockaddr *) &addr, strlen(addr.sun_path) +
-    sizeof (addr.sun_family));
+    sizeof (addr.sun_len) + sizeof (addr.sun_family));
 .DE
 Note that in determining the size of a UNIX domain address null
 bytes are not counted, which is why \fIstrlen\fP is used.  In
 .DE
 Note that in determining the size of a UNIX domain address null
 bytes are not counted, which is why \fIstrlen\fP is used.  In
-the current implementation of UNIX domain IPC under 4.3BSD,
+the current implementation of UNIX domain IPC,
 the file name
 referred to in \fIaddr.sun_path\fP is created as a socket
 in the system file space.
 the file name
 referred to in \fIaddr.sun_path\fP is created as a socket
 in the system file space.