Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ll-xn!mit-eddie!genrad!decvax!mcnc!ece-csc!uvacs!edison!jso From: jso@edison.UUCP (John Owens) Newsgroups: net.unix-wizards Subject: Re: tty select feature Message-ID: <881@edison.UUCP> Date: Tue, 21-Oct-86 11:34:43 EDT Article-I.D.: edison.881 Posted: Tue Oct 21 11:34:43 1986 Date-Received: Thu, 23-Oct-86 18:53:41 EDT References: <4569@brl-smoke.ARPA> Organization: General Electric Company, Charlottesville, VA Lines: 24 Summary: no real violation of spirit.... In article <4569@brl-smoke.ARPA>, art@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@edison.GE.COM old arpa: jso%edison.GE.COM@seismo.CSS.GOV +1 804 978 5726 old uucp: {seismo,decuac,houxm,calma}!edison!jso