Stream: general

Topic: kill_process behavior on Windows


view this post on Zulip Shanoa Ice (Nov 09 2023 at 14:44):

From my knowledge Windows does not support POSIX-style signals, so what will kill_process do on Windows?

view this post on Zulip Jeff Parsons (Nov 09 2023 at 17:21):

Which kill_process is this? Can you link to what you're looking at?

view this post on Zulip Shanoa Ice (Nov 13 2023 at 15:08):

https://docs.rs/rustix/0.38.21/rustix/process/fn.kill_process.html
Should be this one, or does it even exist on Windows?

view this post on Zulip Victor Adossi (Nov 13 2023 at 16:50):

So kill_process depends on the process feature, which depends on linux-raw-sys.linux-raw-sys doesn't seem to be expected to build on windows/non-linux environments at all...

I'd imagine that if you choose to use kill_process you need to to use platform targeting conditional compilation flags as necessary and add alternate strategies for windows.

You may need to use something like winapi's TerminateProcess on the child process your'e trying to actually stop, though I'm not sure how easy that is to do if it's not a child process.


Last updated: Nov 22 2024 at 16:03 UTC