catching segfault using try_ catch

wjoe invalid at example.com
Wed Jul 14 10:28:20 UTC 2021


On Wednesday, 14 July 2021 at 00:10:59 UTC, seany wrote:
> On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote:
>> On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote:
>>> [...]
>>
>> true if it succeeded.
>>
>>> [...]
>>
>> You mean transparently rerun some code? That's better done 
>> with the lowlevel sigaction handler.
>>
>> [...]
>
> Thank you.
>
> Is there a tutorial on the low level sigaction handlers you 
> speak of? Thank oyu

Try core.sys.posix.signal. kill provides a list of signals via 
kill -L.

basically what you do, if I recall correctly (it's been a few 
years), is something like this:
```D
import core.sys.signal;

enum SIGSEGV = 11;
extern (C) void handler(int sig)
{
    switch(sig){
      case SIGSEGV:
        // handle sigsegv
        break;
    }
}

sigset(SIGSEGV, handler);
```


More information about the Digitalmars-d-learn mailing list