From: John Hodge Date: Sun, 9 Feb 2014 10:00:36 +0000 (+0800) Subject: Usermode/libposix - Add baud rates to termios X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=624e1386acc66a0a5fa51fa9c4aa1f616eddaaa4;p=tpg%2Facess2.git Usermode/libposix - Add baud rates to termios --- diff --git a/Usermode/Libraries/libposix.so_src/include_exp/termios.h b/Usermode/Libraries/libposix.so_src/include_exp/termios.h index bb3cf884..38623385 100644 --- a/Usermode/Libraries/libposix.so_src/include_exp/termios.h +++ b/Usermode/Libraries/libposix.so_src/include_exp/termios.h @@ -63,6 +63,22 @@ typedef unsigned short tcflag_t; // c_cflag #define CBAUD (037 << 0) // Baud speed +#define B0 (0 << 0) +#define B50 (1 << 0) +#define B75 (2 << 0) +#define B110 (3 << 0) +#define B134 (4 << 0) +#define B150 (5 << 0) +#define B200 (6 << 0) +#define B300 (7 << 0) +#define B600 (8 << 0) +#define B1200 (9 << 0) +#define B1800 (10 << 0) +#define B2400 (11 << 0) +#define B4800 (12 << 0) +#define B9600 (13 << 0) +#define B19200 (14 << 0) +#define B38400 (15 << 0) #define CSIZE (3 << 5) // Character size mask #define CS5 (0 << 5) #define CS6 (1 << 5) @@ -121,6 +137,7 @@ enum VWERASE, NCCS }; +#define _POSIX_VDISABLE 255 struct termios { @@ -131,6 +148,8 @@ struct termios cc_t c_cc[NCCS]; }; +extern speed_t cfgetospeed(const struct termios *termios_p); + extern int tcgetattr(int fd, struct termios *termios_p); #define TCSANOW 0x01 diff --git a/Usermode/Libraries/libposix.so_src/termios.c b/Usermode/Libraries/libposix.so_src/termios.c index d73de57b..d3aaefac 100644 --- a/Usermode/Libraries/libposix.so_src/termios.c +++ b/Usermode/Libraries/libposix.so_src/termios.c @@ -12,6 +12,11 @@ #include // === CODE === +speed_t cfgetospeed(const struct termios *termios_p) +{ + return termios_p->c_oflag & CBAUD; +} + int tcgetattr(int fd, struct termios *termios_p) { if( fd == -1 ) {