Cygwin: processes: fix handling of native Windows processes

Since commit b5e1003722, native
Windows processes not started by Cygwin processes don't have a
Cygwin PID anymore.  This breaks ps -W and kill -f <WINPID>.

Introduce MAX_PID (65536 for now).

Cygwin processes as well as native Windows processes started
from a Cygwin process get a PID < MAX_PID.  All other native
Windows processes get a faked Cygwin PID >= MAX_PID.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-02-02 12:23:39 +01:00
parent 231ad6941f
commit 448cf5aa4b
3 changed files with 11 additions and 5 deletions

View File

@@ -211,6 +211,8 @@ private:
DWORD status_exit (DWORD);
};
#define MAX_PID 65536
#define ISSTATE(p, f) (!!((p)->process_state & f))
#define NOTSTATE(p, f) (!((p)->process_state & f))