[RTEMS Project] #3800: termios - Add Capability to Generate SIGINTR and SIGQUIT

RTEMS trac trac at rtems.org
Mon May 4 15:30:41 UTC 2020


#3800: termios - Add Capability to Generate SIGINTR and SIGQUIT
-----------------------------------+----------------------------
 Reporter:  Joel Sherrill          |       Owner:  Joel Sherrill
     Type:  enhancement            |      Status:  reopened
 Priority:  normal                 |   Milestone:  5.1
Component:  posix                  |     Version:  5
 Severity:  normal                 |  Resolution:
 Keywords:  termios, POSIX, EINTR  |  Blocked By:
 Blocking:                         |
-----------------------------------+----------------------------

Comment (by Joel Sherrill):

 I added the enum for readability. This is a very odd path and having a
 real name versus a boolean seemed to me to make the code clearer. We could
 add a debug assert before the return RTEMS_TERMIOS_IPROC_CONTINUE and then
 the enum RTEMS_TERMIOS_ISIG_WAS_NOT_PROCESSED would be used.

 I was leaning to improving the readability with the enum names. It was
 also not 100% clear to be that there would not end up ever being a third
 case.

 {{{
 static rtems_termios_iproc_status_code
 iproc (unsigned char c, struct rtems_termios_tty *tty)
 {
   /*
    * If signals are enabled, then allow possibility of VINTR causing
    * SIGINTR and VQUIT causing SIGQUIT. Invoke user provided isig handler.
    */
   if ((tty->termios.c_lflag & ISIG)) {
     if ((c == tty->termios.c_cc[VINTR]) || (c ==
 tty->termios.c_cc[VQUIT])) {
       rtems_termios_isig_status_code rc;
       rc = (*termios_isig_handler)(c, tty);
       if (rc == RTEMS_TERMIOS_ISIG_INTERRUPT_READ) {
          return RTEMS_TERMIOS_IPROC_INTERRUPT;
       }

       return RTEMS_TERMIOS_IPROC_CONTINUE;
     }
   }


 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/3800#comment:10>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list