[comp.unix.sysv386] cbreak mode in ESIX

pim@cti-software.nl (Pim Zandbergen) (08/31/90)

bruce@segue.segue.com (Bruce Adler) writes:

>>	stty eof '^a' eol '^@' -icanon

>How about:
>	stty -icanon min 1 time 0

This is not very safe. I've seen implementations of stty (ISC's I believe)
that will set VMIN to 49 and VTIME to 48 with this specific example.
These are the ascii values of 1 and 0, in case you did not notice.
-- 
Pim Zandbergen                          domain : pim@cti-software.nl
CTI Software BV                         uucp   : uunet!mcsun!hp4nl!ctisbv!pim
Laan Copes van Cattenburch 70           phone  : +31 70 3542302
2585 GD The Hague, The Netherlands      fax    : +31 70 3512837

walter@mecky.UUCP (Walter Mecky) (08/31/90)

In article <3296@segue.segue.com> bruce@segue.segue.com (Bruce Adler) writes:
< In article <3956@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
< >	stty eof '^a' eol '^@' -icanon
< 
< How about:
< 	stty -icanon min 1 time 0

Did you try this?  I suppose no. It doesn't work, because stty is always
interpreting the args as ASCII chars and so your advice yields to set "min"
to 49.
-- 
Walter Mecky	[ walter@mecky.uucp	or  ...uunet!unido!mecky!walter ]

guy@auspex.auspex.com (Guy Harris) (09/01/90)

>How about:
>	stty -icanon min 1 time 0

Maybe S5/386 is different, but the S5R3.1 3B2 code won't handle that - it'll
set VMIN to octal 61, i.e. '1', and VTIME to octal 60, i.e. '0' - and
the S5R3.2-for-the-3B2 documentation says it'll do what the S5R3.1 code
does.

The SunOS 4.x "stty" will handle it, but that's because I changed it
*to* handle it....

guy@auspex.auspex.com (Guy Harris) (09/03/90)

>>< 	stty -icanon min 1 time 0
>
>SCO xenix stty will set it to 1, ISC unix stty to 49.

Vanilla S5R3 and S5R3.1 "stty" behave the way ISC's does, so that's
probably whence ISC's "stty" got that behavior; many other S5R3.2
"stty"s will probably work that way as well.

SunOS 4.x's "stty" behaves the way SCO Xenix's does, and at least
according to the manual page S5R4's "stty" does so as well (that
behavior is the more sensible one; they're numbers, not characters, the
fact that they're stuff into members of an "unsigned char" array
nonwithstanding). 

bruce@segue.segue.com (Bruce Adler) (09/03/90)

In article <3989@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>How about:
>>	stty -icanon min 1 time 0
>
>Maybe S5/386 is different, but the S5R3.1 3B2 code won't handle that - it'll
>set VMIN to octal 61, i.e. '1', and VTIME to octal 60, i.e. '0' ...

You're right. So use:

	stty -icanon min '^a' time '^@'

I guess you (and a few other people) missed the whole point of my 
message.  My intent was to point out that the usage of "min" and "time" 
was guaranteed to work (on SysV) but that overloading "eof" and "eol" 
depends on your kernel implemenation.

Also, my copy of IEEE 300.1 says the kernel is "permitted" (not 
required) to overlap VEOF and VEOL with VMIN and VTIME.  Therefore it's 
also implementation dependent on POSIX compliant systems.  

-- 
bruce@segue.com
ism.isc.com!segue!bruce
aero.org!segue!bruce

guy@auspex.auspex.com (Guy Harris) (09/05/90)

>I guess you (and a few other people) missed the whole point of my 
>message.

No, we just addressed a point brought up by your message, namely that
your suggestion didn't work on all flavors of UNIX.

>My intent was to point out that the usage of "min" and "time" 
>was guaranteed to work (on SysV) but that overloading "eof" and "eol" 
>depends on your kernel implemenation.

The only kernel implementation I know of offhand that doesn't overload
them is the 4.4BSD one (I'm not certain, but I think it doesn't overload
them).  S5Rn for the 386, and SunOS for the 386i, overload them.

For better or worse, some systems take numeric values for the "min" and
"time" arguments to "stty", and others take character arguments; unless
there's some form they all take, using "stty" to set "min" and "time"
therefore also depends on your UNIX implementation.