[comp.unix] Summary setting RS232 port to 8 bits on Tek 4301

jeff@theory.tn.cornell.com (Jeff Miller) (11/28/90)

	In BSD 4.3 it is very easy to do.  Simply set the c_cflag,
to CS8 (meaning character size = 8).  The c_cflag is in the termio.h
header and is easy to set using ioctl.  Unfortunately, some of the
modified versions of BSD do not have the same structures or flags.
For a Tektronix running a modified version of 4.2 BSD the structure
is called "sgttyb" found in the sgtty.h header.  The flags are named
"sg_flags" but they do not have a flag for 7 or 8 bit character size.
It appears that you can either get 7 bit characters with parity or
you can opt for 8 bit characters with no parity.  To set it to 8 bits,
no parity I received two suggestions.  Set the RAW option on the sg_flags
or set the LITOUT (Literal Output) option, also in the sg_flags.  However,
for some applications, including mine, you need 8 bits and a parity bit.
As far as I know this is impossible on the 4.2 BSD modified by Tektronix,
and may be impossible on other machines as well.  I hope someone can prove
me wrong in this information.

If you know of anything else I can try to set 8 bit, even parity email me:
		jeff@theory.tn.cornell.com        Thanks.

guy@auspex.com (Guy Harris) (11/28/90)

>	In BSD 4.3 it is very easy to do.  Simply set the c_cflag,
>to CS8 (meaning character size = 8).

"I see no 'c_cflag' here."

Or did you mean "BSD 4.4", or maybe "BSD 4.3-reno"?

4.3BSD has the same limited terminal driver as older BSD versions did;
they include no way of asking for 8 bits plus a parity bit.  "c_cflag"
comes from the System III terminal driver interface, which is the basis
of the System V interface as well as much of the POSIX interface; it's
present in any S5 system, as well as any POSIX-compliant system (such as
4.4BSD is intended to be, and as I think 4.3-reno moves some of the way
towards being).

It's also in SunOS 4.0 and later, but remember, SunOS is *not* BSD,
although it shares a lot with it.

>For a Tektronix running a modified version of 4.2 BSD the structure
>is called "sgttyb" found in the sgtty.h header.

The same is true of 4.2BSD and of 4.3BSD.  Tektronix didn't take any
functionality away from BSD here.