Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!sun!guy
From: guy@sun.uucp (Guy Harris)
Newsgroups: net.unix-wizards,net.flame
Subject: Re: Re: UNIX-WIZARDS Digest  V1#112 (NIH)
Message-ID: <2574@sun.uucp>
Date: Thu, 8-Aug-85 01:45:56 EDT
Article-I.D.: sun.2574
Posted: Thu Aug  8 01:45:56 1985
Date-Received: Sun, 11-Aug-85 04:55:06 EDT
References: <64@brl-tgr.ARPA> <311@baylor.UUCP> <143@ho95e.UUCP> <208@kitty.UUCP>
Organization: Sun Microsystems, Inc.
Lines: 42
Xref: linus net.unix-wizards:11453 net.flame:10589

> The SIII system I used was a Unisoft port. It didn't require you to diddle
> with MIN and TIME to set CBREAK mode. If you don't you get 4 character
> granularity in reads, and they time out after 2.8 seconds.

How is it going to "require" you to do this?  1000V for 5 seconds through
the seat of your chair?  Assuming you mean "go into a mode where you get
each character as typed" by "set CBREAK mode" (to do this on the S3/S5 tty
driver, you actually clear ICANON mode), you *are* required to diddle with
MIN and TIME on *all* S3/S5 systems if you want proper results.  (Pop
quiz, for people who think they're experts on how the S3/S5 driver works:

	1) Why should the "4 character granularity" be no surprise if
	   MIN isn't set?

	2) Why should the 2.8 second timeout be a *big* surprise, unless
	   the user doesn't like to use the traditional UNIX quit character
	   as a quit character?

Also note that, unless UniSoft broke the tty driver rather badly (which I
consider to be largely outside the realm of possibility), the read "timeout"
isn't really a timeout; the clock doesn't start running until the first
character comes in.

> This broke several programs I was trying to maintain on a system that
> was converted from SIII to SV. I still haven't gotten Xmodem to work
> reliably again

The programs were broken already.  If you turn off ICANON you *must* also
set MIN and TIME to some other values - MIN of 1 and TIME of 0 will emulate
V7's CBREAK mode exactly - if you want reliable results.  If you didn't do
so, go fix your code.

> The 4.2 method of handling timouts is much better, since it ADDS a
> function, instead of CHANGING an existing one.

What "4.2 method of handling timeouts"?  If you mean using
"alarm"/"setitimer", that's in S3/S5 ("alarm", that is; only 4.2BSD has
"setitimer", alas); it's been there since before V6.  If you mean the
timeout in "select", that's a timeout, not a silo drain clock like TIME in
S3/S5 (as was pointed out before).

	Guy Harris