public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Siddh Raman Pant <siddh.raman.pant@oracle•com>
To: "j6t@kdbg•org" <j6t@kdbg•org>,
	"gitster@pobox•com" <gitster@pobox•com>,
	"Johannes.Schindelin@gmx•de" <Johannes.Schindelin@gmx•de>
Cc: "git@vger•kernel.org" <git@vger•kernel.org>,
	"code@khaugsbakk•name" <code@khaugsbakk•name>,
	"newren@gmail•com" <newren@gmail•com>, "ps@pks•im" <ps@pks•im>
Subject: Re: [PATCH] compat/mingw: Allow SIGKILL to kill in mingw_kill.
Date: Fri, 22 May 2026 08:03:56 +0000	[thread overview]
Message-ID: <0b5d9c3c81a4ca078ea5d05d3ac9f6fa2aaafa28.camel@oracle.com> (raw)
In-Reply-To: <xmqqwlwwt0mj.fsf@gitster.g>

[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]

On Fri, May 22 2026 at 12:02:52 +0530, Junio C Hamano wrote:
> 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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-05-22  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-22  6:16 [PATCH] compat/mingw: Allow SIGKILL to kill in mingw_kill Siddh Raman Pant
2026-05-22  6:32 ` Junio C Hamano
2026-05-22  8:03   ` Siddh Raman Pant [this message]
2026-05-28 13:11   ` Johannes Schindelin
2026-05-28 20:28     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0b5d9c3c81a4ca078ea5d05d3ac9f6fa2aaafa28.camel@oracle.com \
    --to=siddh.raman.pant@oracle$(echo .)com \
    --cc=Johannes.Schindelin@gmx$(echo .)de \
    --cc=code@khaugsbakk$(echo .)name \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=j6t@kdbg$(echo .)org \
    --cc=newren@gmail$(echo .)com \
    --cc=ps@pks$(echo .)im \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox