From fa40f30b4253b1e05c46cc5e0c111176825b7623 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Wed, 29 Oct 2003 16:07:11 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'Corpo_2_1_1'. --- mdk-stage1/dietlibc/lib/tcsetattr.c | 46 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 18 deletions(-) (limited to 'mdk-stage1/dietlibc/lib/tcsetattr.c') diff --git a/mdk-stage1/dietlibc/lib/tcsetattr.c b/mdk-stage1/dietlibc/lib/tcsetattr.c index cf70354d2..03fe8adee 100644 --- a/mdk-stage1/dietlibc/lib/tcsetattr.c +++ b/mdk-stage1/dietlibc/lib/tcsetattr.c @@ -1,27 +1,37 @@ -#define tcsetattr libc_tcsetattr #include #include -#undef tcsetattr +#include +#include "dietfeatures.h" -#include +#if !defined(__powerpc__) && !defined(__sparc__) && !defined(__alpha__) && !defined(__hppa__) +#if TCSANOW==0 && TCSADRAIN==1 && TCSAFLUSH==2 && TCSETSW-TCSETS==1 && TCSETSF-TCSETS==2 +#define shortcut +#endif +#endif -extern int errno; +int tcsetattr ( int fildes, int optional_actions, struct termios* termios_p ) +{ +#ifdef shortcut -/* Hack around a kernel bug; value must correspond to the one used in speed.c */ -#define IBAUD0 020000000000 + if ( (unsigned int)optional_actions < 3u ) + return ioctl ( fildes, TCSETS+optional_actions, termios_p ); -int tcsetattr(int fildes, int optional_actions, struct termios *termios_p) -{ - termios_p->c_iflag &= ~IBAUD0; - switch (optional_actions) { - case TCSANOW: - return ioctl(fildes, TCSETS, termios_p); - case TCSADRAIN: - return ioctl(fildes, TCSETSW, termios_p); - case TCSAFLUSH: - return ioctl(fildes, TCSETSF, termios_p); - default: errno = EINVAL; return -1; - } + +#else + + switch ( optional_actions ) { + case TCSANOW: + return ioctl ( fildes, TCSETS , termios_p ); + case TCSADRAIN: + return ioctl ( fildes, TCSETSW, termios_p ); + case TCSAFLUSH: + return ioctl ( fildes, TCSETSF, termios_p ); + default: + errno = EINVAL; + return -1; + } + +#endif } -- cgit v1.2.1