Re: Spawning a process, then killing it on SIGINT

2019-11-24 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/24/19 10:36 AM, aliak wrote: On Saturday, 23 November 2019 at 12:19:27 UTC, Steven Schveighoffer wrote: On 11/23/19 4:54 AM, aliak wrote: Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Pid currentSpawnedPi

Re: Spawning a process, then killing it on SIGINT

2019-11-24 Thread aliak via Digitalmars-d-learn
On Saturday, 23 November 2019 at 12:19:27 UTC, Steven Schveighoffer wrote: On 11/23/19 4:54 AM, aliak wrote: Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Pid currentSpawnedPid; extern(C) void killCurrentPidHand

Re: Spawning a process, then killing it on SIGINT

2019-11-24 Thread aliak via Digitalmars-d-learn
On Saturday, 23 November 2019 at 10:09:51 UTC, mipri wrote: On Saturday, 23 November 2019 at 09:54:48 UTC, aliak wrote: Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Well, this works: import std; import core.s

Re: Spawning a process, then killing it on SIGINT

2019-11-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/23/19 4:54 AM, aliak wrote: Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Pid currentSpawnedPid; extern(C) void killCurrentPidHandler(int sig) nothrow @nogc @system {   kill(currentSpawnedPid, sig); } int

Re: Spawning a process, then killing it on SIGINT

2019-11-23 Thread mipri via Digitalmars-d-learn
On Saturday, 23 November 2019 at 09:54:48 UTC, aliak wrote: Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Well, this works: import std; import core.stdc.signal; extern(C) int kill(int pid, int sig) nothrow @no

Spawning a process, then killing it on SIGINT

2019-11-23 Thread aliak via Digitalmars-d-learn
Is there a way to go about killing a process after spawning it on a SIGINT? I can't do this for e.g. because kill is not @nogc. Pid currentSpawnedPid; extern(C) void killCurrentPidHandler(int sig) nothrow @nogc @system { kill(currentSpawnedPid, sig); } int main() { currentSpawnedPid = sp