diff options
author | Robert de Bath <rdebath@poboxes.com> | 1996-05-31 21:33:17 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:30:46 +0200 |
commit | e85ee07172eccafd9441362e774f7b184810d008 (patch) | |
tree | 5dc12259ab7a61b12d9df284fe58ad5cb312c526 /libc/termios/termios.c | |
parent | dcc973ea3e31710429858c99d4f040334ac67c06 (diff) | |
download | dev86-e85ee07172eccafd9441362e774f7b184810d008.tar.gz |
Import Dev86-0.0.6.tar.gzv0.0.6
Diffstat (limited to 'libc/termios/termios.c')
-rw-r--r-- | libc/termios/termios.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/libc/termios/termios.c b/libc/termios/termios.c index 3789c38..a617e86 100644 --- a/libc/termios/termios.c +++ b/libc/termios/termios.c @@ -140,7 +140,7 @@ int fd; #endif #ifdef L_cfgetospeed -int cfgetospeed(tp) +speed_t cfgetospeed(tp) struct termios *tp; { return (tp->c_cflag & CBAUD); @@ -148,7 +148,7 @@ struct termios *tp; #endif #ifdef L_cfgetispeed -int cfgetispeed(tp) +speed_t cfgetispeed(tp) struct termios *tp; { return (tp->c_cflag & CBAUD); @@ -181,5 +181,40 @@ struct termios *tp; speed_t speed; return cfsetospeed(tp, speed); } #endif + +/* From linux libc-4.6.27 again */ +#ifdef L_cfmakeraw +/* Copyright (C) 1992 Free Software Foundation, Inc. +This file is part of the GNU C Library.*/ + +void +cfmakeraw(t) +struct termios *t; +{ +/* I changed it to the current form according to the suggestions + * from Bruce Evans. Thanks Bruce. Please report the problems to + * H.J. Lu (hlu@eecs.wsu.edu). + */ + +/* + * I took out the bits commented out by #if 1...#else - RHP + */ + + /* VMIN = 0 means non-blocking for Linux */ + t->c_cc[VMIN] = 1; t->c_cc[VTIME] = 1; + /* clear some bits with &= ~(bits), set others with |= */ + t->c_cflag &= ~(CSIZE|PARENB|CSTOPB); + t->c_cflag |= (CS8|HUPCL|CREAD); + t->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|INPCK|ISTRIP); + t->c_iflag &= ~(INLCR|IGNCR|ICRNL|IXON|IXOFF); + t->c_iflag |= (BRKINT|IGNPAR); + t->c_oflag &= ~(OPOST|OLCUC|OCRNL|ONOCR|ONLRET|OFILL|OFDEL); + t->c_oflag &= ~(NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY); + t->c_oflag |= (ONLCR|NL0|CR0|TAB3|BS0|VT0|FF0); + t->c_lflag &= ~(ISIG|ICANON|IEXTEN|ECHO|ECHOE|ECHOK|ECHONL); + t->c_lflag &= ~(NOFLSH|XCASE); + t->c_lflag &= ~(ECHOPRT|ECHOCTL|ECHOKE); +} +#endif #endif |