Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:15

0001 /**
0002  * @file
0003  * TERMIOS POSIX behavior on INTR and QUIT characters
0004  */
0005 
0006 /*
0007  *  COPYRIGHT (c) 1989-2012,2019.
0008  *  On-Line Applications Research Corporation (OAR).
0009  *
0010  *  SPDX-License-Identifier: BSD-2-Clause
0011  */
0012 
0013 #ifdef HAVE_CONFIG_H
0014 #include "config.h"
0015 #endif
0016 
0017 #include <rtems.h>
0018 #include <rtems/libio.h>
0019 #include <rtems/termiostypes.h>
0020 
0021 #include <signal.h>
0022 
0023 rtems_termios_iproc_status_code rtems_termios_posix_isig_handler(
0024   unsigned char             c,
0025   struct rtems_termios_tty *tty
0026 )
0027 {
0028   int sig;
0029 
0030   if ( c == tty->termios.c_cc[ VQUIT ] ) {
0031     sig = SIGQUIT;
0032   } else {
0033     sig = SIGINT;
0034   }
0035 
0036   (void) raise( sig );
0037 
0038   return RTEMS_TERMIOS_IPROC_INTERRUPT;
0039 }