Get faulting address on SIGSEGV
I try to write a shared memory for a distributed computing system.
In order to implement a kind of paging for this I want to invalidate the addresses of memory-pages that are currently not valid (using 'mprotect').
Then, to page-in I want to catch SIGSEGV signals, and give them a special treatment if they occured because of any of the shared memory addresses.
In order to do so I need to check if the faulting address is part of my shared memory.
Is there some way to get the faulting address on a SIGSEGV signal?
Thanks for any help!