Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Control modes

&pagelevel(5)&pagelevel

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

CLOCAL

Ignore modem status

CREAD

Enable receiver

CSIZE

CS5

CS6

CS7

CS8

Character size (number of bits per byte):

5 bits

6 bits

7 bits

8 bits

  • CS5

5 bits

  • CS6

6 bits

  • CS7

7 bits

  • CS8

8 bits

CSTOPB

Send 2 stop bits (else 1)

HUPCL

Hang up on last close()

PARENB

Enable parity detection

PARODD

Enable odd parity

In addition, the input and output baud rates are stored in the termios structure. The following values are supported:

Name

Definition

B0

Hang up

B50

50 baud

B75

75 baud

B110

110 baud

B134

134.5 baud

B150

150 baud

B200

200 baud

B300

300 baud

B600

600 baud

B1200

1200 baud

B1800

1800 baud

B2400

2400 baud

B4800

4800 baud

B9600

9600 baud

B19200

19200 baud

B38400

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.