X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finflow.h;h=fe8c005be0db2500551e49a5b8606546c914d566;hb=975f8708de015fb2b813edbf8b714f4777c57a41;hp=428aed41b1ab298aea97b2d49da4aa0d58225f16;hpb=be628ab814f1c90e185d7482d27aa8a991ab5837;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inflow.h b/gdb/inflow.h index 428aed41b1..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-2017 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 "gdb_termios.h" +#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 */