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 00:23:29
On Tue, Jul 03, 2007 at 06:40:02PM +0000, Christos Zoulas wrote:
> >
> > 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. But you also need to handle the case
> where the NO_DEV_PTM option or whatever it is called is enabled (perhaps
> just fail then).

Yes I was thinking of failing in that case - or forcing the dependency
in the kernel build for the non-loadable emulation module.

> 2 grants the pty on open, 0 does not. You'll need to
> test or trusss a solaris binary to see what the c library does.
> I am guessing 0.

I suspect that the 'grant' action is an effective 'noop' if not actually
required.

I've also suddenly wondered whether the tty side minor numbering rules are
correct!  (which I suspect also applies to linux emulation)

	David

-- 
David Laight: david@l8s.co.uk