diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-05-20 17:09:12 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-05-20 17:09:12 +0000 |
commit | 27dccaec154688ce1e89ebafbb8209104b13c7c6 (patch) | |
tree | 402c40571ff208ec1f4cd7e7971b9f4c03bed366 | |
parent | Patch from Ralf Corseipus to fix latent configure problems suddenly triggered: (diff) | |
download | rtems-27dccaec154688ce1e89ebafbb8209104b13c7c6.tar.bz2 |
Patch to add return status to rtems_termios_enqueue_raw_characters from
Eric Norum per request from Geoffroy Montel:
> The rtems_termios_enqueue_raw_characters function type is void.
> The problem is that I can't return an error message if the input
> buffer is full.
> Could we add a return value?
Sure, but what would you do with the overflow indication? POSIX says,
``when the input limit is reached, the saved characters are thrown away
without notice''.
Anyhow, the change is so small I've done it and enclosed the patch.
-rw-r--r-- | c/src/exec/libcsupport/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | c/src/exec/libcsupport/src/termios.c | 4 | ||||
-rw-r--r-- | c/src/lib/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | c/src/lib/libc/libio.h | 2 | ||||
-rw-r--r-- | c/src/lib/libc/termios.c | 4 | ||||
-rw-r--r-- | cpukit/libcsupport/include/rtems/libio.h | 2 | ||||
-rw-r--r-- | cpukit/libcsupport/src/termios.c | 4 |
7 files changed, 13 insertions, 7 deletions
diff --git a/c/src/exec/libcsupport/include/rtems/libio.h b/c/src/exec/libcsupport/include/rtems/libio.h index 0826579805..3cc87d1d87 100644 --- a/c/src/exec/libcsupport/include/rtems/libio.h +++ b/c/src/exec/libcsupport/include/rtems/libio.h @@ -156,7 +156,7 @@ rtems_status_code rtems_termios_close (void *arg); rtems_status_code rtems_termios_read (void *arg); rtems_status_code rtems_termios_write (void *arg); rtems_status_code rtems_termios_ioctl (void *arg); -void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); void rtems_termios_dequeue_characters (void *ttyp, int len); void rtems_termios_reserve_resources( rtems_configuration_table *configuration, diff --git a/c/src/exec/libcsupport/src/termios.c b/c/src/exec/libcsupport/src/termios.c index a41817b28a..b2d1bb1499 100644 --- a/c/src/exec/libcsupport/src/termios.c +++ b/c/src/exec/libcsupport/src/termios.c @@ -837,8 +837,9 @@ rtems_termios_read (void *arg) * Place characters on raw queue. * NOTE: This routine runs in the context of the * device receive interrupt handler. + * Returns the number of characters dropped because of overlow. */ -void +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { struct rtems_termios_tty *tty = ttyp; @@ -855,6 +856,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) tty->rawInBufTail = newTail; } rtems_semaphore_release (tty->rawInBufSemaphore); + return len; } /* diff --git a/c/src/lib/include/rtems/libio.h b/c/src/lib/include/rtems/libio.h index 0826579805..3cc87d1d87 100644 --- a/c/src/lib/include/rtems/libio.h +++ b/c/src/lib/include/rtems/libio.h @@ -156,7 +156,7 @@ rtems_status_code rtems_termios_close (void *arg); rtems_status_code rtems_termios_read (void *arg); rtems_status_code rtems_termios_write (void *arg); rtems_status_code rtems_termios_ioctl (void *arg); -void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); void rtems_termios_dequeue_characters (void *ttyp, int len); void rtems_termios_reserve_resources( rtems_configuration_table *configuration, diff --git a/c/src/lib/libc/libio.h b/c/src/lib/libc/libio.h index 0826579805..3cc87d1d87 100644 --- a/c/src/lib/libc/libio.h +++ b/c/src/lib/libc/libio.h @@ -156,7 +156,7 @@ rtems_status_code rtems_termios_close (void *arg); rtems_status_code rtems_termios_read (void *arg); rtems_status_code rtems_termios_write (void *arg); rtems_status_code rtems_termios_ioctl (void *arg); -void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); void rtems_termios_dequeue_characters (void *ttyp, int len); void rtems_termios_reserve_resources( rtems_configuration_table *configuration, diff --git a/c/src/lib/libc/termios.c b/c/src/lib/libc/termios.c index a41817b28a..b2d1bb1499 100644 --- a/c/src/lib/libc/termios.c +++ b/c/src/lib/libc/termios.c @@ -837,8 +837,9 @@ rtems_termios_read (void *arg) * Place characters on raw queue. * NOTE: This routine runs in the context of the * device receive interrupt handler. + * Returns the number of characters dropped because of overlow. */ -void +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { struct rtems_termios_tty *tty = ttyp; @@ -855,6 +856,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) tty->rawInBufTail = newTail; } rtems_semaphore_release (tty->rawInBufSemaphore); + return len; } /* diff --git a/cpukit/libcsupport/include/rtems/libio.h b/cpukit/libcsupport/include/rtems/libio.h index 0826579805..3cc87d1d87 100644 --- a/cpukit/libcsupport/include/rtems/libio.h +++ b/cpukit/libcsupport/include/rtems/libio.h @@ -156,7 +156,7 @@ rtems_status_code rtems_termios_close (void *arg); rtems_status_code rtems_termios_read (void *arg); rtems_status_code rtems_termios_write (void *arg); rtems_status_code rtems_termios_ioctl (void *arg); -void rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len); void rtems_termios_dequeue_characters (void *ttyp, int len); void rtems_termios_reserve_resources( rtems_configuration_table *configuration, diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index a41817b28a..b2d1bb1499 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -837,8 +837,9 @@ rtems_termios_read (void *arg) * Place characters on raw queue. * NOTE: This routine runs in the context of the * device receive interrupt handler. + * Returns the number of characters dropped because of overlow. */ -void +int rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) { struct rtems_termios_tty *tty = ttyp; @@ -855,6 +856,7 @@ rtems_termios_enqueue_raw_characters (void *ttyp, char *buf, int len) tty->rawInBufTail = newTail; } rtems_semaphore_release (tty->rawInBufSemaphore); + return len; } /* |