Please follow what Eric has suggested for configure code.
I have made some changes to your code, which might work: ` --- a/dlls/ntdll/unix/serial.c +++ b/dlls/ntdll/unix/serial.c @@ -63,6 +63,9 @@ #endif #include <linux/serial.h> #endif +#ifdef HAVE_ASM_TERMBITS_H +#include <asm/termbits.h> +#endif
#if !defined(TIOCINQ) && defined(FIONREAD) #define TIOCINQ FIONREAD @@ -119,6 +122,16 @@ static const char* iocode2str(UINT ioc)
static NTSTATUS get_baud_rate(int fd, SERIAL_BAUD_RATE* sbr) { +#ifdef HAVE_ASM_TERMBITS_H + struct termios2 port; + + if (ioctl(fd, TCGETS2, &port) == -1) + { + ERR("ioctl TCGETS2 error '%s'\n", strerror(errno)); + return errno_to_status( errno ); + } + sbr->BaudRate = port.c_ospeed; +#else struct termios port; int speed;
@@ -192,6 +205,7 @@ static NTSTATUS get_baud_rate(int fd, SERIAL_BAUD_RATE* sbr) ERR("unknown speed %x\n", speed); return STATUS_INVALID_PARAMETER; } +#endif return STATUS_SUCCESS; }
@@ -453,6 +467,25 @@ static NTSTATUS purge(int fd, DWORD flags)
static NTSTATUS set_baud_rate(int fd, const SERIAL_BAUD_RATE* sbr) { +#ifdef HAVE_ASM_TERMBITS_H + struct termios2 port; + + if (ioctl(fd, TCGETS2, &port) == -1) + { + ERR("ioctl TCGETS2 error '%s'\n", strerror(errno)); + return errno_to_status( errno ); + } + + port.c_cflag &= ~CBAUD; + port.c_cflag |= BOTHER; + port.c_ospeed = sbr->BaudRate; + + if (ioctl(fd, TCSETS2, &port) == -1) + { + ERR("ioctl TCSETS2 error '%s'\n", strerror(errno)); + return errno_to_status( errno ); + } +#else struct termios port;
if (tcgetattr(fd, &port) == -1) @@ -564,6 +597,7 @@ static NTSTATUS set_baud_rate(int fd, const SERIAL_BAUD_RATE* sbr) ERR("tcsetattr error '%s'\n", strerror(errno)); return errno_to_status( errno ); } +#endif return STATUS_SUCCESS; } `