libio: Add rtems_libio_iop_is_no_delay()

Update #3132.
This commit is contained in:
Sebastian Huber
2017-09-13 10:24:25 +02:00
parent e2b1db2311
commit bbcdc302cd
4 changed files with 13 additions and 3 deletions

View File

@@ -1379,6 +1379,16 @@ static inline uint32_t rtems_libio_iop_flags( const rtems_libio_t *iop )
return iop->flags;
}
/**
* @brief Returns true if this is a no delay iop, otherwise returns false.
*
* @param[in] iop The iop.
*/
static inline bool rtems_libio_iop_is_no_delay( const rtems_libio_t *iop )
{
return ( rtems_libio_iop_flags( iop ) & LIBIO_FLAGS_NO_DELAY ) != 0;
}
/**
* @name External I/O Handlers
*/

View File

@@ -1230,7 +1230,7 @@ static uint32_t
rtems_termios_write_tty (rtems_libio_t *iop, rtems_termios_tty *tty,
const char *buf, uint32_t len)
{
bool wait = ((iop->flags & LIBIO_FLAGS_NO_DELAY) == 0);
bool wait = !rtems_libio_iop_is_no_delay (iop);
if (tty->termios.c_oflag & OPOST) {
uint32_t todo = len;

View File

@@ -32,7 +32,7 @@
#include "pipe.h"
#define LIBIO_ACCMODE(_iop) (rtems_libio_iop_flags(_iop) & LIBIO_FLAGS_READ_WRITE)
#define LIBIO_NODELAY(_iop) ((_iop)->flags & LIBIO_FLAGS_NO_DELAY)
#define LIBIO_NODELAY(_iop) rtems_libio_iop_is_no_delay(_iop)
static rtems_id pipe_semaphore = RTEMS_ID_NONE;

View File

@@ -794,7 +794,7 @@ rtems_bsdnet_fcntl (rtems_libio_t *iop, int cmd)
rtems_bsdnet_semaphore_release ();
return EBADF;
}
if (iop->flags & LIBIO_FLAGS_NO_DELAY)
if (rtems_libio_iop_is_no_delay(iop))
so->so_state |= SS_NBIO;
else
so->so_state &= ~SS_NBIO;