system's "kill <pid>" signal

Konstantin Kutsevalov via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 6 08:09:09 PST 2016


On Saturday, 5 November 2016 at 06:17:51 UTC, Basile B. wrote:
> On Saturday, 5 November 2016 at 02:24:00 UTC, Konstantin 
> Kutsevalov wrote:
>> Hi,
>>
>> is there a way to catch system signal of "kill" command or 
>> "shutdown"?
>
> During the Run-time:
> ====================
>
> You can register a signal callback, like in this sample (hit 
> CTRL+C once running in a terminal):
>
>
> After termination:
> ==================
>
> if (tryWait(PID)[0] == true) then the value carried by 
> tryWait(PID)[1] will tell you if the process has exited because 
> of a signal whatever it's, e.g SIGKILL, SIGTERM, SIGINT, ...

Thank you!


More information about the Digitalmars-d-learn mailing list