3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "support/lyxlib.h"
15 #ifdef HAVE_SYS_TYPES_H
16 # include <sys/types.h>
21 #include "support/debug.h"
22 #include "support/os.h"
30 int support::kill(int pid, int sig)
33 if (pid == (int)GetCurrentProcessId())
35 HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
37 LYXERR0("kill OpenProcess failed!");
40 if (!TerminateProcess(hProcess, sig)) {
41 LYXERR0("kill process failed!");
42 CloseHandle(hProcess);
45 CloseHandle(hProcess);
48 return ::kill(pid, sig);