Technical data
SunOS 5.5 Ioctl Requests termio(7I)
To store the input speed in the termios structure pointed to by termios_p see the follow-
ing code segment.
unsigned long ispeed;
if (ispeed == 0) {
ispeed = termios_p->c_cflag & CBAUD;
if (termios_p->c_cflag & CBAUDEXT)
ispeed += (CBAUD + 1);
}
if ((ispeed << IBSHIFT) > CIBAUD) {
termios_p->c_cflag |= CIBAUDEXT;
ispeed -= ((CIBAUD >> IBSHIFT) + 1);
} else
termios_p->c_cflag &= ˜CIBAUDEXT;
termios_p->c_cflag =
(termios_p->c_cflag & ˜CIBAUD) |
((ispeed << IBSHIFT) & CIBAUD);
The CSIZE bits specify the character size in bits 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 is used. For example, at 110 baud, two stops bits are required.
If PARENB is set, parity generation and detection is enabled, and a parity bit is added to
each character. If parity is enabled, the PARODD flag specifies odd parity if set; other-
wise, even parity is used.
If CREAD is set, the receiver is enabled. Otherwise, no characters are received.
If HUPCL is set, the line is disconnected when the last process with the lineopen closes it
or terminates. That is, the data-terminal-ready signalis not asserted.
If CLOCAL is set, the line is assumed to be a local, direct connection with no modem con-
trol; otherwise, modem control is assumed.
If CRTSCTS is set, inbound hardware flow control is enabled.
If CRTSCTS is set, outbound hardware flow control is enabled.
The four possible combinations for the state of CRTSCTS and CRTSXOFF bits and their
interactions are described below.
Case A: CRTSCTS off, CRTSXOFF off.
In this case the hardware flow control is disabled.
Case B: CRTSCTS on, CRTSXOFF off.
In this case only outbound hardware flow control is enabled. The state of CTS
signal is used to do outbound flow control. It is expected that output will be
suspended if CTS is low and resumed when CTS is high.
Case C: CRTSCTS off, CRTSXOFF on.
In this case only inbound hardware flow control is enabled. The state of RTS
modified 30 May 1995 7I-357










