X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/3edcb7c8a826cfd3c8bba9583cf9fe182c49b40d..fd88f5c5678c80ff5e338adc372d28a52ad20530:/usr/src/share/doc/psd/21.ipc/2.t diff --git a/usr/src/share/doc/psd/21.ipc/2.t b/usr/src/share/doc/psd/21.ipc/2.t index a290b5ad34..217d7c7d02 100644 --- a/usr/src/share/doc/psd/21.ipc/2.t +++ b/usr/src/share/doc/psd/21.ipc/2.t @@ -1,22 +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. .\" -.\" %sccs.include.redist.roff% +.\" 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 5.1 (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 -.bp .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 +.sp 2 .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 @@ -34,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 -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 -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 -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 +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 @@ -123,6 +153,7 @@ simulated at the user level. More information on this topic 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 @@ -239,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) + - 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 -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.