windows:
HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
if (hProc)
{
if (TerminateProcess(hProc, 0) == 0)
{
CloseHandle(hProc);
throw SystemException("cannot kill process");
}
CloseHandle(hProc);
}
linux:
kill(pid, SIGKILL)