X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Finflow.h;h=73b1b01a27b1ccff2aaa2b39908b9b35b621b199;hb=036003a671233c43e35b3004f91e4cbd61255cf3;hp=064e773eac0f3ff1787c40b21e0a0514f032f097;hpb=7e1789f556ec6ba5c736abcb81e0a08ba31673ab;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inflow.h b/gdb/inflow.h index 064e773eac..73b1b01a27 100644 --- a/gdb/inflow.h +++ b/gdb/inflow.h @@ -1,6 +1,6 @@ /* Low level interface to ptrace, for GDB when running under Unix. - Copyright (C) 2003, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2003-2019 Free Software Foundation, Inc. This file is part of GDB. @@ -20,17 +20,37 @@ #ifndef INFLOW_H #define INFLOW_H -#include "terminal.h" /* For HAVE_TERMIOS et.al. */ +#include +#include +#include "gdbsupport/job-control.h" -#ifdef HAVE_TERMIOS -# define PROCESS_GROUP_TYPE pid_t -#elif defined (HAVE_TERMIO) || defined (HAVE_SGTTY) -# define PROCESS_GROUP_TYPE int +/* RAII class used to ignore SIGTTOU in a scope. */ + +class scoped_ignore_sigttou +{ +public: + scoped_ignore_sigttou () + { +#ifdef SIGTTOU + if (job_control) + m_osigttou = signal (SIGTTOU, SIG_IGN); +#endif + } + + ~scoped_ignore_sigttou () + { +#ifdef SIGTTOU + if (job_control) + signal (SIGTTOU, m_osigttou); #endif + } + + DISABLE_COPY_AND_ASSIGN (scoped_ignore_sigttou); -#ifdef PROCESS_GROUP_TYPE -/* Process group of the current inferior. */ -extern PROCESS_GROUP_TYPE inferior_process_group (void); +private: +#ifdef SIGTTOU + sighandler_t m_osigttou = NULL; #endif +}; #endif /* inflow.h */