diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:31:57 +0000 |
commit | 09e967c2d732783b2579e4e120cd9b608404cb00 (patch) | |
tree | 8d2783a6a7e33608c6012efd6a88b8f5694df81d /mdk-stage1/dietlibc/lib/tcsetattr.c | |
parent | 18fcff49d3c836697d3b75a3d01d31c700e69974 (diff) | |
download | drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.gz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.bz2 drakx-09e967c2d732783b2579e4e120cd9b608404cb00.tar.xz drakx-09e967c2d732783b2579e4e120cd9b608404cb00.zip |
Merge from R9_0-AMD64, most notably:
- AMD64 support to insmod-busybox, minilibc, et al.
- Sync with insmod-modutils 2.4.19 something but everyone should use
dietlibc nowadays
- Factor out compilation and prefix with $(DIET) for dietlibc builds
- 64-bit & varargs fixes
Diffstat (limited to 'mdk-stage1/dietlibc/lib/tcsetattr.c')
-rw-r--r-- | mdk-stage1/dietlibc/lib/tcsetattr.c | 46 |
1 files changed, 28 insertions, 18 deletions
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 <termios.h> #include <sys/ioctl.h> -#undef tcsetattr +#include <errno.h> +#include "dietfeatures.h" -#include <asm/errno.h> +#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 } |