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>
30 int lyx::support::kill(int pid, int sig)
33 if (pid == (int)GetCurrentProcessId()) {
36 HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
38 lyxerr << "kill OpenProcess failed!" << endl;
41 if (!TerminateProcess(hProcess, sig)){
42 lyxerr << "kill process failed!" << endl;
43 CloseHandle(hProcess);
46 CloseHandle(hProcess);
52 return ::kill(pid, sig);