Hello, It looks like in order to effectively kill the process by Windows means (i.e. what Cygwin "kill -f" is supposed to do), the process handle must be obtained with the SYNCHRONIZE right (in addition to PROCESS_TERMINATE), otherwise WaitForSingleObject() fails with code 5, permission denied (at least for a regular user, i.e. not an administrator).
That's about this portion of kill.cc located at winsup\utils: HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid); if (!h) { if (!wait || GetLastError () != ERROR_INVALID_PARAMETER) fprintf (stderr, "%s: couldn't open pid %u\n", prog_name, (unsigned) dwpid); return; } if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0) if (sig && !TerminateProcess (h, sig << 8) && WaitForSingleObject (h, 200) != WAIT_OBJECT_0) fprintf (stderr, "%s: couldn't kill pid %u, %lu\n", prog_name, (unsigned) dwpid, GetLastError ()); MSDN is in agreement with the observed behavior (access denied), http://msdn.microsoft.com/en-us/library/windows/desktop/ms684320%28v=vs.85%29.aspx <quote> The handle returned by the OpenProcess function can be used in any function that requires a handle to a process, such as the wait functions, provided the appropriate access rights were requested. </quote> http://msdn.microsoft.com/en-us/library/windows/desktop/ms684880%28v=vs.85%29.aspx HTH, Anton Lavrentiev Contractor NIH/NLM/NCBI