Problem: How to set mark and space parity

Customer wants to understand how to set mark and space parity
from AIX in a C program.


termio.h        - parext, or extpar.
Need to send a byte with mark set, next data with space set.

He does want to use 'mark' and 'space' parity.  This would
seem to be possible, but is fairly archaic.

THis can be set in a semipermanent manner with:

chdev  -l 'tty0' -a parity='mark'

But the user wants to use an ioctl, or similar call to set.

Database shows development message says:
The magic settings are:

  Parity        c_cflag bits
  ------        ------------
  odd           PARENB | PARODD
  even          PARENB
  mark          PARENB | PARODD | PAREXT
  space         PARENB | PAREXT

When switching parity settings, you need to make sure that output has
completely drained from the serial port.  Use the POSIX-style tcdrain()
call or the traditional TCSBRK ioctl (with a non-zero argument so as
not to put an actual break condition on the line).

Be advised that this may not match the mark/space conventions of other
Unix'es.  When this was being implemented, I solicited input from the
usenet newgroups on how this was being implemented (so that we would
be compatible).  No information was forthcoming, so we just picked a

NILM:  Left this information on VM

Support Line: Problem: How to set mark and space parity ITEM: BA0710L
Dated: October 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:24
Comments or suggestions? Contact us