tty select feature

John Owens jso at edison.UUCP
Wed Oct 22 01:34:43 AEST 1986


In article <4569 at brl-smoke.ARPA>, art at ACC.arpa writes:
> [...] ttselect() [...] contains the following line:
> 	register struct tty *tp = &cdevsw[major(dev)].d_ttys[minor(dev)];

> This code assumes that the minor device number can be used as an index into
> the driver's tty structure array.  My understanding is that ONLY THE DRIVER
> should interpret the meaning and format of the minor device number. [....]
> But I still object to code outside of the driver making assuptions about
> the format of the driver's tty structure array and minor number.

I agree with the principle, but I don't see this as a violation.  I
would consider ttselect() to be part of the driver code; when writing
your driver, you can write your own select routine, possibly calling
ttselect(), or, if you understand the way ttselect() works, you can
use that instead, making this generic routine logically part of your
driver.  Since it's up to the driver writer, and not in some part of
the kernel not under the driver's control, I don't see a problem.

If such dependencies were noticed and documented, the world would, of
course, be a better place to write drivers in....

John Owens		General Electric Company - Charlottesville, VA
jso at edison.GE.COM	old arpa: jso%edison.GE.COM at seismo.CSS.GOV
+1 804 978 5726		old uucp: {seismo,decuac,houxm,calma}!edison!jso



More information about the Comp.unix.wizards mailing list