Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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 b47b59f7f..ed8a4aecf 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