UNIX-WIZARDS Digest V1#112 (NIH)

Guy Harris guy at sun.uucp
Thu Aug 8 15:45:56 AEST 1985


> 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



More information about the Comp.unix.wizards mailing list