git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat/mingw: Allow SIGKILL to kill in mingw_kill.

From
Siddh Raman Pant <siddh.raman.pant@oracle.com>
Date
May 22, 2026, 08:03 UTC
Message-ID
<0b5d9c3c81a4ca078ea5d05d3ac9f6fa2aaafa28.camel@oracle.com>
In-Reply-To
<xmqqwlwwt0mj.fsf@gitster.g>
On Fri, May 22 2026 at 12:02:52 +0530, Junio C Hamano wrote:
Show 15 quoted lines
> I do not do windows, so I'd like to ask those much more clueful than
> I am to see if they see any downsides.
> 
> The current code only handles TERM (to terminate) or 0 (to probe)
> and everything else results in EINVAL, so the updated behaviour is
> to pretend as if TERM is sent and do whatever PROCESS_TERMINATE
> does, instead of doing nothing and erroring with EINVAL.  Which does
> sound like an improvement over the status quo.
> 
> What I am wondering is if there are different kind of "kill" in the
> Windows land, just like there are distinction between TERM and KILL.
> For example, the program ought to be able to block TERM but not
> KILL.  There are other termination-inducing signals like SIGQUIT but
> until we start using them in our code, this emulation layer does not
> have to know about them, I think.

From what I can see from the docs, there is no SIGTERM on Windows either. So I did this change since the SIGTERM handling just looks like a compatibility change in our code.

The docs at [1] says:
	The SIGILL and SIGTERM signals aren't generated under Windows.
	They're included for ANSI compatibility. Therefore, you can set
	signal handlers for these signals by using signal, and you can
	also explicitly generate these signals by calling raise.
Our helper uses TerminateProcess(). The docs at [2] says:
	The TerminateProcess function is used to unconditionally cause
	a process to exit.
	[...]
	A process cannot prevent itself from being terminated.
which is like SIGKILL.
So currently SIGTERM on Windows is behaving like a SIGKILL.

Thanks, Siddh

[1] https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/signal [2] https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess

Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 5 in “compat/mingw: Allow SIGKILL to kill in mingw_kill.”
  1. compat/mingw: Allow SIGKILL to kill in mingw_kill.Siddh Raman Pant, May 22, 2026
  2. Junio C HamanoMay 22, 2026
  3. Siddh Raman PantMay 22, 2026
  4. Johannes SchindelinMay 28, 2026
  5. Junio C HamanoMay 28, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.