I want to set a signal handler in my application, so that the kernel sends a signal whenever it handles a page fault trap. Ofcourse I can use the SIGSEGV signal handler, but what I’m really interested in is to catch the page faults which occur on copy-on-write. For example after a fork (not followed by exec), the original process will get a page fault if it tries to write to some page. I want to get notified on such page faults. How can I achieve this?
I want to set a signal handler in my application, so that the kernel
Share
page faults are interrupts handled by do_page_fault()
Signals also generate an interrupt. The difference is that the page fault interrupt is vectored to the code. There is an explanation of what the code does. IMO, always generating another interrupt in a an interrupt handler is a bad idea.
Tell us: What are you trying to accomplish? Not how you think it should be done.