On Tuesday, 18 September 2018 at 00:24:23 UTC, SrMordred wrote:
On Tuesday, 18 September 2018 at 00:12:35 UTC, Diederik de Groot wrote:
On Monday, 17 September 2018 at 23:44:41 UTC, SrMordred wrote:
[...]

You can use core.stdc.signal
nothrow @nogc @system sigfn_t signal(SIGSEGV, sigfn_t func)
To catch the signal
With a handler signature of:
enum void function(int) nothrow @nogc @system SIG_ERR;

[...]

Yes, i'm using signal(SIGSEGV, sigfn_t func), it catches correctly, but end the execution after.

I find the alternatives of setjmp/longjmp and sigaction, but none are avaliable on windows afaik.

Aah ok. I think signal() and sigaction() are equivalent. Don't know about setjmp/longjmp not being available on D-windows. They are defined in core.sys.posix, so not directly available on windows per definition. They might be available under mingw.

If you think this is an oversight (as they are part of libc in general) and see a definite need, it should not be too hard to add them, i would think. You would have to ask someone with knowledge and access to windows to help you out though (A druntime PR would be welcome).

Reply via email to