diff options
Diffstat (limited to 'compat/mingw.c')
-rw-r--r-- | compat/mingw.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 47a0e8861d..146a6ed79c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -936,6 +936,25 @@ void mingw_execv(const char *cmd, char *const *argv) mingw_execve(cmd, argv, environ); } +int mingw_kill(pid_t pid, int sig) +{ + if (pid > 0 && sig == SIGTERM) { + HANDLE h = OpenProcess(PROCESS_TERMINATE, FALSE, pid); + + if (TerminateProcess(h, -1)) { + CloseHandle(h); + return 0; + } + + errno = err_win_to_posix(GetLastError()); + CloseHandle(h); + return -1; + } + + errno = EINVAL; + return -1; +} + static char **copy_environ(void) { char **env; |