aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pinfo.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-05 19:43:04 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-05-05 19:43:04 +0000
commitd8ff96389f6beb97defd285b224fead3f37398f5 (patch)
tree5246416567fc69e322ca413e0d0c11db29dbe607 /winsup/cygwin/pinfo.h
parent23db0a41d8b178d6f3d2297834b28e015346bd43 (diff)
downloadnewlib-d8ff96389f6beb97defd285b224fead3f37398f5.zip
newlib-d8ff96389f6beb97defd285b224fead3f37398f5.tar.gz
newlib-d8ff96389f6beb97defd285b224fead3f37398f5.tar.bz2
* pinfo.h (class push_process_state): New class to push a process state
flag temporarily into myself->process_state. * fhandler_console.cc (fhandler_console::read): Add push_process_state handler. (fhandler_console::write): Call bg_check from here. Add push_process_state handler. * fhandler_tty.cc (fhandler_tty_slave::write): Ditto. (fhandler_tty_slave::read): Ditto. (fhandler_pty_master::write): Ditto. (fhandler_pty_master::read): Ditto. * syscalls.cc (readv): Remove bg_check call and setting process state. (writev): Ditto.
Diffstat (limited to 'winsup/cygwin/pinfo.h')
-rw-r--r--winsup/cygwin/pinfo.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h
index b47b59f..ed8a4ae 100644
--- a/winsup/cygwin/pinfo.h
+++ b/winsup/cygwin/pinfo.h
@@ -224,6 +224,23 @@ cygwin_pid (pid_t pid)
void __stdcall pinfo_init (char **, int);
extern pinfo myself;
+/* Helper class to allow convenient setting and unsetting a process_state
+ flag in myself. This is used in certain fhandler read/write methods
+ to set the PID_TTYIN/PID_TTYOU flags in myself->process_state. */
+class push_process_state
+{
+private:
+ int flag;
+public:
+ push_process_state (int add_flag)
+ {
+ flag = add_flag;
+ myself->process_state |= flag;
+ }
+ void pop () { myself->process_state &= ~(flag); }
+ ~push_process_state () { pop (); }
+};
+
#define _P_VFORK 0
#define _P_SYSTEM 512
/* Add this flag in calls to spawn_guts if the calling function is one of