X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finflow.h;h=fe8c005be0db2500551e49a5b8606546c914d566;hb=975f8708de015fb2b813edbf8b714f4777c57a41;hp=28403c5deed730a1c6d3951636eab903bb9d8863;hpb=7b6bb8daaceb9ecf3f42dea57ae82733d6a3b2f6;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inflow.h b/gdb/inflow.h index 28403c5dee..fe8c005be0 100644 --- a/gdb/inflow.h +++ b/gdb/inflow.h @@ -1,7 +1,6 @@ /* Low level interface to ptrace, for GDB when running under Unix. - Copyright (C) 2003, 2005, 2007, 2008, 2009, 2010, 2011 - Free Software Foundation, Inc. + Copyright (C) 2003-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -21,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 */