The OP wrote, "I am looking for a "clean" way to terminate processes I've created on both Linux and Windows." ... The PID returned from fork is apparently useless. When I kill 1 $child_pid, the main process complains Terminating
Did you test your "solution" against his setting?
First of all, I don't have access to Windows 11 right now, so I cannot test it. So, only he can test the solution that I wrote. Btw this works fine on Windows XP.
Secondly, if you are not sure whether this solution works or not on Windows 11, why do you downvote my answer? If you have tested it and know for a fact that it does not work, then you may downvote it. Otherwise, you're abusing the system by just downvoting answers that you know nothing about whether they work or not. (Yes, I have tested my answer on Windows XP, Windows 7, and Windows 10. I have found that most things that work on XP also work on later versions, but this is not true the other way around. If I was using Windows 11, and I had a solution to something, it might not work on Windows XP, because that's just how Microsoft is...)
In reply to Re^3: How to portably stop processes?
by harangzsolt33
in thread How to portably stop processes?
by haj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |