From: andy@madhouse.demon.co.uk (Andrew Bray) Subject: Re: The great serial device naming controversy.... Date: Tue, 1 Jun 1993 11:16:52 +0000
In article <1993Jun1.003441.13958@kf8nh.wariat.org> bsa@kf8nh.wariat.org (Brandon S. Allbery) writes:
>In article <1udvsdINN4an@senator-bedfellow.MIT.EDU> jfc@athena.mit.edu (John F Carr) writes:
>>I like the AIX pty naming convention: if you want a pty, open /dev/ptc.
>>This allocates a new pty master; you can find the name of the pty slave
>>with a ttyname call. You get an effectively infinite number of ptys and
>>the code to allocate them is simpler. The tty slave names are of the form
>>/dev/pts/3. /dev/pt[sc] are special files, not directories; whatever is
>>left in the pathname ("/3" for "/dev/pts/3" is passed to the kernel open
>>routine).
>
>Sounds like STREAMS ptys. Unfortunately, Linux doesn't have a STREAMS
>implementation --- yet. I think someone said one was planned, but I wouldn't
>expect one in the near future given that the revised sockets code is still in
>alpha test and STREAMS is an alternative to sockets.
The main difference in functionality that I can see is that under the AIX way
of doing things you can access *by name* any pty using only 1 inode each
for the master and slave side. To do this under streams and the clone
driver you must have 2 inodes per pty plus one for the clone device entry.
Unlike things like net connections, you really do want to be able to reach
ptys by name (e.g. for the write and who commands).
However, we could change the pty code so that a certain magic minor device
did a search for a free pty. THen you could find out which one you got by
an ioctl.
Regards,
Andy