From 3cad2919622e6dbab273fdf772b8bf33653553b9 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 1 Oct 1999 15:55:30 +0000 Subject: Addition of more functionality by Eric Norum to support GNU readline. --- cpukit/libcsupport/src/tcflow.c | 33 +++++++++++++++++++++++++++++++++ cpukit/libcsupport/src/tcflush.c | 33 +++++++++++++++++++++++++++++++++ cpukit/libcsupport/src/tcsetattr.c | 13 +++++++++++-- 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 cpukit/libcsupport/src/tcflow.c create mode 100644 cpukit/libcsupport/src/tcflush.c (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/src/tcflow.c b/cpukit/libcsupport/src/tcflow.c new file mode 100644 index 0000000000..bbe60d94be --- /dev/null +++ b/cpukit/libcsupport/src/tcflow.c @@ -0,0 +1,33 @@ +/* + * tcflow() - POSIX 1003.1b 7.2.2 - Line Control Functions + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include +#if defined(RTEMS_NEWLIB) + +#include +#include +#include +#include +/* #include */ + +int ioctl(); + +#include + +int tcflow (int fd, int action) +{ + return 0; +} + +#endif diff --git a/cpukit/libcsupport/src/tcflush.c b/cpukit/libcsupport/src/tcflush.c new file mode 100644 index 0000000000..3a14eba129 --- /dev/null +++ b/cpukit/libcsupport/src/tcflush.c @@ -0,0 +1,33 @@ +/* + * tcflush() - POSIX 1003.1b 7.2.2 - Line Control Functions + * + * COPYRIGHT (c) 1989-1998. + * On-Line Applications Research Corporation (OAR). + * Copyright assigned to U.S. Government, 1994. + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include +#if defined(RTEMS_NEWLIB) + +#include +#include +#include +#include +/* #include */ + +int ioctl(); + +#include + +int tcflush (int fd, int queue) +{ + return 0; +} + +#endif diff --git a/cpukit/libcsupport/src/tcsetattr.c b/cpukit/libcsupport/src/tcsetattr.c index cc1ca205a5..a769ff250f 100644 --- a/cpukit/libcsupport/src/tcsetattr.c +++ b/cpukit/libcsupport/src/tcsetattr.c @@ -32,9 +32,18 @@ int tcsetattr( struct termios *tp ) { - if ( opt != TCSANOW ) + switch (opt) { + default: set_errno_and_return_minus_one( ENOTSUP ); - return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); + case TCSADRAIN: + if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0) + return -1; + /* + * Fall through to.... + */ + case TCSANOW: + return ioctl( fd, RTEMS_IO_SET_ATTRIBUTES, tp ); + } } #endif -- cgit v1.2.3