Subject: Replacing svr4_ptm_alloc() with ptmopen()
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/01/2007 21:09:18
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 ?

	David

[1] The minor number is the major of the device to actually open, its
open that was called with the CLONEOPEN flag set, and it returned the
new minor number, the clone driver then hacked together all the system
structures.  Replaced with a scheme that allowed VOP_OPEN() to return
a different vnode, and the char special code would do that if any driver
open modified the dev_t parameter.  (Things like exec didn't like it though.)

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