Operating System - HP-UX
1834326 Members
3313 Online
110066 Solutions
New Discussion

How to get access type in signal handler for SIGSEGV signal

 
Canedo Joseph
New Member

How to get access type in signal handler for SIGSEGV signal

Hello all,

I am writing a signal handler to catch up page faults and I would like to know in the signal handler whenever an instruction made a fault in read or write mode (access to a pointer reading data from it or writing data to it). I can get the faulty address but not the access mode to it.
One solution could be to fetch the instruction from the PC and from it deduce if the access was in read or in write. But I have no idea on how to get the PC value at the time of the page fault (what register is in PA2.0 ?) and no idea on a pattern to use on instructions....

Thanks for your help,

Best regards

Joseph Canedo