summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-24 14:44:04 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-28 09:09:23 +0100
commit36635433921323438501e1ffc21392c094773765 (patch)
tree8113d0ff6ae69ea49de608f15899c7b877cb6451 /cpukit/libcsupport
parenttermios: Make write POSIX compatible (diff)
downloadrtems-36635433921323438501e1ffc21392c094773765.tar.bz2
termios: Implement non-blocking write
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/termios.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index e59f97799c..d1058997f8 100644
--- a/cpukit/libcsupport/src/termios.c
+++ b/cpukit/libcsupport/src/termios.c
@@ -1214,9 +1214,10 @@ oproc (unsigned char c, rtems_termios_tty *tty, bool wait)
}
static uint32_t
-rtems_termios_write_tty (rtems_termios_tty *tty, const char *buf, uint32_t len)
+rtems_termios_write_tty (rtems_libio_t *iop, rtems_termios_tty *tty,
+ const char *buf, uint32_t len)
{
- bool wait = true;
+ bool wait = ((iop->flags & LIBIO_FLAGS_NO_DELAY) == 0);
if (tty->termios.c_oflag & OPOST) {
uint32_t todo = len;
@@ -1252,7 +1253,8 @@ rtems_termios_write (void *arg)
rtems_semaphore_release (tty->osem);
return sc;
}
- args->bytes_moved = rtems_termios_write_tty (tty, args->buffer, args->count);
+ args->bytes_moved = rtems_termios_write_tty (args->iop, tty,
+ args->buffer, args->count);
rtems_semaphore_release (tty->osem);
return sc;
}
@@ -2162,7 +2164,7 @@ rtems_termios_imfs_write (rtems_libio_t *iop, const void *buffer, size_t count)
return (ssize_t) args.bytes_moved;
}
- bytes_moved = rtems_termios_write_tty (tty, buffer, count);
+ bytes_moved = rtems_termios_write_tty (iop, tty, buffer, count);
rtems_semaphore_release (tty->osem);
return (ssize_t) bytes_moved;
}