Terminal interface and non-standard baudrates

Frank Schaefer schaefer.frank@gmx.net
Tue May 26 18:53:00 GMT 2009


Hello,

A question/feature request related to the terminal interface / serial port:
On Linux, there are two possibilities to select non-standrad baudrates.
The old/deprecated solution is to set the baudrate to B38400 and do an
additional ioctl(... TIOCSSERIAL, struct serial_struct ) with a custom
divisor and the ASYNC_SPD_CUST-flag selected in the serial_struct.
The new solution (introduced in 2007 ?) is to ORe the c_cflag of struct
termios with BOTHER (= CBAUDEX | B0). In this case, the
c_ispeed/c_ospeed-fields contain the baudrate directly.
I noticed that BOTHER is not defined/available when I include
<termios.h> and that c_ispeed/c_ospeed always contain (c_cflag & CBAUD),
so I assume that this is currently not supported by the C-library, right ?
Would it be possible to add this feature to the C-library ?

Regards,

Frank



More information about the Libc-help mailing list