Subject: Re: Replacing svr4_ptm_alloc() with ptmopen()
To: David Laight <david@l8s.co.uk>
From: Christos Zoulas <christos@zoulas.com>
List: tech-kern
Date: 07/04/2007 17:26:59
On Jul 4,  9:56pm, david@l8s.co.uk (David Laight) wrote:
-- Subject: Re: Replacing svr4_ptm_alloc() with ptmopen()

| 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 ?

There is /usr/share/examples/compat/svr4/etc/SVR4_MAKEDEV..

| 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.

But that should be done by mounting ptyfs...

| In which case the code in compat/svr4/svr4_net.c (for ptmx) can just
| be deleted.

Right.

christos