#3800 closed enhancement (fixed)

termios - Add Capability to Generate SIGINTR and SIGQUIT

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: normal Milestone: 5.1
Component: posix Version: 5
Severity: normal Keywords: termios, POSIX, EINTR
Cc: Blocked By:

Description (last modified by Joel Sherrill)

Currently the RTEMS termios implementation does not examine the ISIG setting in the termios attributes and thus does not examine input for the INTR (ctl-C) and QUIT (ctl-\) characters. As a consequence, it cannot return -1/EINTR.

The proposed solution implements a point at which a default handler can do nothing like currently or the application can use the following new method which allows them to register the RTEMS provided method rtems_termios_posix_isig_handler().

rtems_termios_isig_status_code rtems_termios_register_isig_handler(
  rtems_termios_isig_handler handler

The method rtems_termios_posix_isig_handler() is provided and has the POSIX compliant behavior of generating SIGINTR for the VINTR character and SIGQUIT for the VQUIT character.

The user also can register rtems_termios_default_isig_handler() to return to the default behavior.

The tests termios10 (polled IO) and termios11 (interrupt driven IO) are added to exercise this behavior.

Change History (2)

comment:1 Changed on Oct 7, 2019 at 9:39:22 PM by Joel Sherrill

Description: modified (diff)
Keywords: EINTR added

comment:2 Changed on Oct 9, 2019 at 7:34:25 PM by Joel Sherrill <joel@…>

Resolution: fixed
Status: assignedclosed

In 667501a/rtems:

termios: Add Capability to Generate SIGINTR and SIGQUIT

This patch adds the ability for termios to send SIGINTR on receipt
of VINTR and SIGQUIT for VKILL and return -1/EINTR from read() on
a termios channel. Importantly, this patch does not alter the default
behavior or force POSIX signal code in just because termios is used.
The application must explicitly enable the POSIX behavior of generating
a signal upon receipt of these characters. This is discussed in the
POSIX standard:


Closes #3800.

Note: See TracTickets for help on using tickets.