*BSD News Article 18745


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!metro!sequoia!ultima!kralizec.zeta.org.au!kralizec.zeta.org.au!not-for-mail
From: bde@kralizec.zeta.org.au (Bruce Evans)
Newsgroups: comp.os.386bsd.questions
Subject: Re: sio - problem with login hanging up
Date: 23 Jul 1993 02:46:47 +1000
Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.32bis
Lines: 43
Message-ID: <22mg9nINNlud@kralizec.zeta.org.au>
References: <226elvINNt54@kralizec.zeta.org.au> <CADpLy.8Dw@sugar.NeoSoft.COM> <22epf0INNt7q@kralizec.zeta.org.au> <CAILGB.1B7@sugar.NeoSoft.COM>
NNTP-Posting-Host: kralizec.zeta.org.au

In <CAILGB.1B7@sugar.NeoSoft.COM> peter@NeoSoft.com (Peter da Silva) writes:

>In article <22epf0INNt7q@kralizec.zeta.org.au> bde@kralizec.zeta.org.au (Bruce Evans) writes:

>> >This shouldn't work. When stty closes the port, it should revert to the
>> >default configuration.

>> Because it is the last close?  The old driver didn't do that.

>Why does that matter? A last close on any tty type device should reset it
>to a default configuration. You shouldn't have to create special cases to
>retain default behaviour, as in the case of a user setting clocal and
>hanging up. Changing the default should be a rare case, and can be handled
>with an ioctl.

The reason is so that programs don't have to know about the configuration:

	stty `cat settings` </dev/ttyX
	myprog </dev/ttyX >/dev/ttyX

I use this a lot with myprog == zmodem.

>The old driver was broken, so let's keep that broken behaviour?

I don't think not having a default configuration is broken.  Programs need
to initialise _all_ they tty state that they care about.  getty ought
to clear clocal on ports connected to modems, and leave it unchanged for
ports connected to terminals.  There ought to be stuff in /etc/gettytab
to control this.  I don't think there is.  Anyway, it would get blown
away when getty sets fixed defaults before exec'ing login.  The fixed
defaults include clearing of clocal.  I thought this would be good enough
because most ports are connected to modems and cables to terminals should
have CD wired on.  However, sio doesn't act early enough on the clearing
of clocal, so getty sometimes gets wedged echoing to modems.

>... One of the nicest things about UNIX in the old days was the
>interfaces were simple, consistent, and required not a lot of code to
>do the normal sorts of things. Now, this is a very MINOR deviation, but
>it is one and it's easy to fix.

You mean like the simple, consistent interface of stty and getty[tab] ;-).
-- 
Bruce Evans  bde@kralizec.zeta.org.au