The control modes described below have no significance for BS2000 computers.
The c_cflag
field describes the hardware control of the terminal. The following elements are supported for character-oriented terminals:
Mask name | Definition |
| Ignore modem status |
| Enable receiver |
| Character size (number of bits per byte): 5 bits 6 bits 7 bits 8 bits |
| 5 bits |
| 6 bits |
| 7 bits |
| 8 bits |
| Send 2 stop bits (else 1) |
| Hang up on last |
| Enable parity detection |
| Enable odd parity |
In addition, the input and output baud rates are stored in the termios
structure. The following values are supported:
Name | Definition |
| Hang up |
| 50 baud |
| 75 baud |
| 110 baud |
| 134.5 baud |
| 150 baud |
| 200 baud |
| 300 baud |
| 600 baud |
| 1200 baud |
| 1800 baud |
| 2400 baud |
| 4800 baud |
| 9600 baud |
| 19200 baud |
| 38400 baud |
The following interfaces are provided for getting and setting the values of the input and output baud rates in the termios
structure:cfgetispeed()
, cfgetospeed()
, cfsetispeed()
and cfsetospeed()
.
The CSIZE
bits specify the character size in bits per byte for both transmission and reception. This size does not include the parity bit, if any. If CSTOPB
is set, two stop bits are used, otherwise one stop bit. For example, at 110 baud, two stop bits are normally used.
If CREAD
is set, the receiver is enabled. If CREAD
is not set, no characters are received.
If PARENB
is set, parity generation and detection is enabled, i.e. a parity bit is added to each character. If parity is enabled, the PARODD
bit specifies odd parity be used; otherwise, even parity is used.
If HUPCL
is set, the line will be disconnected when the last process to use the line closes it or terminates. This means that the Data-Terminal-Ready (DTR
) signal will be disabled, thus breaking the modem connection.
If CLOCAL
is set, the existing line is assumed to be a local, direct connection with no modem control. The connection does not depend on line signals in this case. Otherwise, modem control is assumed, and the modem status lines are monitored.
Under normal circumstances, a call to the open()
function waits for the modem connection to complete. However, if the O_NONBLOCK
flag is set when calling open()
, or if the CLOCAL
bit is set, the open()
function returns immediately without waiting for the connection.
If the object for which the control modes are set is not an asynchronous serial connection, some of the modes may be ignored; e.g., if an attempt is made to set the baud rate on a network connection to a terminal on another host, the baud rate may or may not be set on the connection between that terminal and the machine to which it is directly connected.
The initial value for the control modes (value of c_oflag
) after a call to open()
is that no flag is set.