This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Terminal interface and non-standard baudrates
- From: Frank Schaefer <schaefer dot frank at gmx dot net>
- To: libc-help at sourceware dot org
- Date: Tue, 26 May 2009 20:54:01 +0200
- Subject: Terminal interface and non-standard baudrates
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