Re: ptsname() support (new ptys)

C. Scott Ananian (cananian@lcs.mit.edu)
Thu, 15 Jan 1998 03:16:10 -0500 (EST)


On Thu, 15 Jan 1998 hpa@transmeta.com (H. Peter Anvin) wrote:

> By author: "C. Scott Ananian" <cananian@lcs.mit.edu>
> In newsgroup: linux.dev.kernel
> >
> > I have started the implementation of Unix98-style ptys for Linux. It's
> > not terribly difficult; just another ioctl for ptsname, and /dev/ptmx is
> > handled the same way /dev/tty and /dev/tty0 are (ie, device number rewrite
> > on open).
>
> I would also make the kernel create device nodes in /dev/pts/* and
> chown() them to the right user. I would use the setgid bit on the
> /dev/pts directory to make sure they end up in the right group.

The permissions are done for free when you use devfs in conjunction with
the patch. I think that's the "right" solution to this problem (the
kernel has no business creating files).

Most of the Unix98 support is really a library issue. In particular,
naming issues are best handled by the library. I just tried to create the
minimal patch that would allow the library writers to do their thing.

> > 2) Where should the device number for /dev/ptmx go?
> > I'd like to keep it with the other tty stuff, so I'm leaning towards
> > an allocation in character device major 5...
>
> That's probably the best. Contact me for an official assignment.

I'm waiting to see if Linus likes my patch. Tentatively I'm using 5,2.
There aren't any conflicts on that yet, are there? [I found none listed.]
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian