summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/tcsetattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/libcsupport/src/tcsetattr.c')
-rw-r--r--cpukit/libcsupport/src/tcsetattr.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/cpukit/libcsupport/src/tcsetattr.c b/cpukit/libcsupport/src/tcsetattr.c
index 556abee4a7..6b6afda718 100644
--- a/cpukit/libcsupport/src/tcsetattr.c
+++ b/cpukit/libcsupport/src/tcsetattr.c
@@ -35,23 +35,32 @@
* POSIX 1003.1b 7.2.1 - Get and Set State
*/
int tcsetattr(
- int fd,
- int opt,
- struct termios *tp
+ int fd,
+ int opt,
+ const struct termios *tp
)
{
- switch (opt) {
- default:
- rtems_set_errno_and_return_minus_one( ENOTSUP );
+ struct termios localterm;
+
+ if (opt & TCSASOFT) {
+ localterm = *tp;
+ localterm.c_cflag |= CIGNORE;
+ tp = &localterm;
+ }
+
+ switch (opt & ~TCSASOFT) {
- 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 );
+ return ioctl( fd, TIOCSETA, tp );
+
+ case TCSADRAIN:
+ return ioctl( fd, TIOCSETAW, tp );
+
+ case TCSAFLUSH:
+ return ioctl( fd, TIOCSETAF, tp );
+
+ default:
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
}
#endif