X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finflow.h;h=fe8c005be0db2500551e49a5b8606546c914d566;hb=a435742a7fb32f6320ce0e6074e2500e28378104;hp=4077dfc96f9ba6ffb1eb82aa365c7e31685798dc;hpb=32d0add0a654c1204ab71dc8a55d9374538c4b33;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inflow.h b/gdb/inflow.h index 4077dfc96f..fe8c005be0 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-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2020 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 */