Cygwin: kill(1): introduce a -W option

Allow to kill processes using Windows PIDs on the command line.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-02-02 21:02:00 +01:00
parent 3a3934252c
commit 658f939003
4 changed files with 59 additions and 20 deletions

View File

@@ -322,6 +322,15 @@ cygwin_internal (cygwin_getinfo_types t, ...)
res = p ? p->dwProcessId : 0;
}
break;
case CW_WINPID_TO_CYGWIN_PID:
{
DWORD winpid = va_arg (arg, DWORD);
pid_t pid = cygwin_pid (winpid);
res = pid ?: winpid + MAX_PID;
}
break;
case CW_EXTRACT_DOMAIN_AND_USER:
{
WCHAR nt_domain[MAX_DOMAIN_NAME_LEN + 1];