
termio(7I) Ioctl Requests SunOS 5.5
CBAUDEXT Bit to indicate output speed > B38400
CIBAUDEXTBit to indicate input speed > B38400
The CBAUD bits together with the CBAUDEXT bit specify the output baud rate. To
retrieve the output speed from the termios structure pointed to by termios_p see the fol-
lowing code segment.
unsigned long ospeed;
if (termios_p->c_cflag & CBAUDEXT)
ospeed = (termios_p->c_cflag & CBAUD) + CBAUD + 1;
else
ospeed = termios_p->c_cflag & CBAUD;
To store the output speed in the termios structure pointed to by termios_p see the follow-
ing code segment.
unsigned long ospeed;
if (ospeed > CBAUD) {
termios_p->c_cflag |= CBAUDEXT;
ospeed -= (CBAUD + 1);
} else
termios_p->c_cflag &= ˜CBAUDEXT;
termios_p->c_cflag =
(termios_p->c_cflag & ˜CBAUD) | (ospeed & CBAUD);
The zero baud rate, B0, is used to hang up the connection. If B0 is specified, the data-
terminal-ready signal is not asserted. Normally, this disconnects the line.
If the CIBAUDEXT or CIBAUD bits are not zero, they specify the input baud rate, with
the CBAUDEXT and CBAUD bits specifying the output baud rate; otherwise, the output
and input baud rates are both specified by the CBAUDEXT and CBAUD bits. The values
for the CIBAUD bits are the same as the values for the CBAUD bits, shifted left IBSHIFT
bits. For any particular hardware, impossible speed changesare ignored. To retrieve the
input speed in the termios structure pointed to by termios_p see the following code seg-
ment.
unsigned long ispeed;
if (termios_p->c_cflag & CIBAUDEXT)
ispeed = ((termios_p->c_cflag & CIBAUD) >> IBSHIFT)
+ (CIBAUD >> IBSHIFT) + 1;
else
ispeed = (termios_p->c_cflag & CIBAUD) >> IBSHIFT;
7I-356 modified 30 May 1995
Kommentare zu diesen Handbüchern