diff options
Diffstat (limited to 'winsup/cygwin/pinfo.h')
-rw-r--r-- | winsup/cygwin/pinfo.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/winsup/cygwin/pinfo.h b/winsup/cygwin/pinfo.h index aa1fb8c76..b062934da 100644 --- a/winsup/cygwin/pinfo.h +++ b/winsup/cygwin/pinfo.h @@ -36,19 +36,12 @@ public: constants below. */ DWORD process_state; - /* If hProcess is set, it's because it came from a - CreateProcess call. This means it's process relative - to the thing which created the process. That's ok because - we only use this handle from the parent. */ - HANDLE hProcess; - -#define PINFO_REDIR_SIZE ((char *) &myself.procinfo->hProcess - (char *) myself.procinfo) + DWORD exitcode; /* set when process exits */ - /* Handle associated with initial Windows pid which started it all. */ - HANDLE pid_handle; +#define PINFO_REDIR_SIZE ((char *) &myself.procinfo->exitcode - (char *) myself.procinfo) - /* Handle to the logical parent of this pid. */ - HANDLE ppid_handle; + /* > 0 if started by a cygwin process */ + DWORD cygstarted; /* Parent process id. */ pid_t ppid; @@ -120,7 +113,9 @@ public: HANDLE sendsig; private: sigset_t sig_mask; - CRITICAL_SECTION lock; +public: + HANDLE wr_proc_pipe; + friend class pinfo; }; class pinfo @@ -129,12 +124,18 @@ class pinfo _pinfo *procinfo; bool destroy; public: + HANDLE rd_proc_pipe; + HANDLE hProcess; + CRITICAL_SECTION lock; + /* Handle associated with initial Windows pid which started it all. */ + HANDLE pid_handle; void init (pid_t, DWORD, HANDLE = NULL) __attribute__ ((regparm(3))); pinfo () {} - pinfo (_pinfo *x): procinfo (x) {} - pinfo (pid_t n) {init (n, 0);} - pinfo (pid_t n, DWORD flag) {init (n, flag);} + pinfo (_pinfo *x): procinfo (x), hProcess (NULL), pid_handle (NULL) {} + pinfo (pid_t n) : rd_proc_pipe (NULL), hProcess (NULL), pid_handle (NULL) {init (n, 0);} + pinfo (pid_t n, DWORD flag) : rd_proc_pipe (NULL), hProcess (NULL), pid_handle (NULL) {init (n, flag);} void release (); + int wait () __attribute__ ((regparm (1))); ~pinfo () { if (destroy && procinfo) @@ -151,6 +152,8 @@ public: _pinfo *operator * () const {return procinfo;} operator _pinfo * () const {return procinfo;} // operator bool () const {return (int) h;} + void preserve () { destroy = false; } + void alert_parent (char); #ifndef _SIGPROC_H int remember () {system_printf ("remember is not here"); return 0;} #else @@ -210,9 +213,6 @@ extern pinfo myself; #define _P_VFORK 0 #define _P_SYSTEM 512 -extern void __stdcall pinfo_fixup_after_fork (); -extern HANDLE hexec_proc; - /* For mmaps across fork(). */ int __stdcall fixup_mmaps_after_fork (HANDLE parent); /* for shm areas across fork (). */ |