Subject: Re: Replacing svr4_ptm_alloc() with ptmopen()
To: Christos Zoulas <christos@astron.com>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/04/2007 21:56:30
On Tue, Jul 03, 2007 at 06:40:02PM +0000, Christos Zoulas wrote:
> David Laight <david@l8s.co.uk> wrote:
> >There is code in compat/svr4/svr4_net.c that (I suspect) is implementing
> >the SVR3/4 'clone' device driver [1].
> >
> >For pseudo ttys it calls svr4_ptm_alloc() which loops through some
> >/dev/ptyXX names then returns EMOVEFD in order for TRT to happen back
> >in sys_open().
> >
> >I suspect that call to svr4_ptm_alloc() could be replaced by a call to
> >ptmopen() (in kern/tty_ptm.c) and it would all still work.
> >
> >Is that correct? and should it use minor 0 or 2 ?
>
> Yes, it should be done this way.
Actually I've had a further thought...
Is there anything that helps you setup the /emul/xxx/dev for the svr4
emulations ?
It seems easiest to just point the /dev/ptmx entry at netbsd's ptmx
driver (but I do think you want minor 2). You also need to setup
the /dev/pts/nnn (or /dev/ptsnnn for older svr4) entries.
In which case the code in compat/svr4/svr4_net.c (for ptmx) can just
be deleted.
David
--
David Laight: david@l8s.co.uk