Re: PROPOSAL: /proc/dev

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sun, 4 Jan 1998 12:38:50 +0000 (GMT)


> functionality (I don't remember the name of the interface that allocates a
> new master pty - but we can certainly avoid the horror of walking through
> all pty's one at a time until we find a non-busy one). Our current
> pty-opening strategy is the original (fairly broken) BSD one, and just
> about everybody else has moved on to another way of finding a pty to open.

Streams based systems open a stream clone device which then hands them on
the next free "pty". There then tends to be all sorts of "magic" to get
the pty's probable name for use with things like write.

There are very good reasons however pty's should be handed out by a daemon
which keeps its own pty allocation maps. For one it means unused tty/pty
pairs will be owned by root and chowned by a root owned process without
needing the requester to be setuid, for the second it can update the utmp.

We can't do this in 2.0.x however as AF_UNIX sockets behave like BSD and
don't have credential information giving the uid/gid of the source reliably.

> Having zillions of pty's in devfs is not something I'd like to see.

We still need zillions of tty sides for write for ttyname() and for vast
numbers of other legacy uses.

Alan