Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!dcl-cs!aber-cs!pcg From: pcg@aber-cs.UUCP (Piercarlo Grandi) Newsgroups: comp.unix.i386 Subject: Re: Creating a socket with ISC's libinet.a Summary: /dev/spx is stream named pipe, /dev/ptmx is stream ptys Message-ID: <1590@aber-cs.UUCP> Date: 17 Jan 90 17:20:58 GMT Reply-To: pcg@cs.aber.ac.uk (Piercarlo Grandi) Organization: Dept of CS, UCW Aberystwyth (Disclaimer: my statements are purely personal) Lines: 51 In article <1990Jan16.011859.5080@mks.com> eric@mks.com (Eric Gisin) writes: I figured all this out while trying to decide what it would take to build X11.4 on 386/IX. It looks like you could easily build it with either socket emulation or native streams. Use native streams! A lot of us out here don't have ethernet, and want to run X. Once you have done streams, sockets is trivial. But you would only get tcp based connections, not local connections. The reverse, if you use streams. Or maybe you mean TLI... Has anyone reverse engineered the local connection code that Interactive uses? It is different that the scheme ATT uses in lib/X/XStream.c. Interactive uses /dev/spx, while ATT uses /dev/ptmx. Are either of these devices documented? /dev/spx is a clone device for stream pipes. It is not really documented, but in the AT&T stream manuals they give as an example the source for a driver for stream pipes; methinks that /dev/spx is exactly that driver, without even too many bells and whistles. Actually I think that in normal use you just want to clone /dev/spx, and then the returned filedescriptor can be used as a pipe. I actually reckon that if all pipes in the system were done with streams, they would be faster (as are the socket/mbuf based pipes of BSD). Just wait until SysV.4... "/dev/ptmx" is the clone device of the stream ptys. What they do is fairly easy to understand if you look at "/usr/include/sys/pt*.h"... Actually it is not really different from a stream pipe; you open the clone device, and you get in the minor of the returned filedescriptor the number fo the couple of /dev/pt[sm] devices that you have been allocated; a stream pipe exists between the two sides, master and slave. Then you push "ldterm" on the slave part, and that's it. I think that for X11 one should not push "ldterm", unless the X11 protocol has been changed to require processing through a line discipline (:-> :-> :->), and just use /dev/spmx as a generator of named pipes. In the GNU emacs for SysV.3.2 patches that I posted a while ago there is a section on using stream ptys instead of BSD compatible ptys, and the code is very generic. -- Piercarlo "Peter" Grandi | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcvax!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk