diff options
author | Kevin Kirspel <kevin-kirspel@idexx.com> | 2017-03-21 15:39:48 -0400 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-03-22 11:55:04 +0100 |
commit | 1c6926c11f2e5efcb166c668b097d64a0321d66e (patch) | |
tree | 30683dcf11979f51273413aade68a3828d00da10 /cpukit/libcsupport/src/tcsetattr.c | |
parent | bsp/atsam: Fix DMA support of some drivers (diff) | |
download | rtems-1c6926c11f2e5efcb166c668b097d64a0321d66e.tar.bz2 |
termios: Synchronize with latest FreeBSD headers
Adding modified FreeBSD headers to synchronize RTEMS termios with
FreeBSD. Modify termios to support dedicated input and output baud for
termios structure. Updated BSPs to use dedicated input and output baud
in termios structure. Updated tools to use dedicated input and output
baud in termios structure. Updated termios testsuites to use dedicated
input and output baud in termios structure.
Close #2897.
Diffstat (limited to 'cpukit/libcsupport/src/tcsetattr.c')
-rw-r--r-- | cpukit/libcsupport/src/tcsetattr.c | 35 |
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 |