Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

User exception handler in C (Developers)

posted by tkchia Homepage, 19.08.2020, 18:52

Hello Laaca,

> The setting the my handler is in the source: "signal(SIGILL, catch_rdtsc)"
> but it would be nice to call something like "signal(SIGILL, orig_handler)"

The POSIX function sigaction(...) allows one to retrieve the originally active signal handler and action information. Apparently Free Pascal calls it fpSigAction: https://www.freepascal.org/docs-html/rtl/baseunix/fpsigaction.html .

And yes, if you are sure that no other routine in your program is trying to hook SIGILL at that point, you can probably get away with signal(SIGILL, SIG_DFL). :-)

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

 

Complete thread:

Back to the forum
Board view  Mix view
22758 Postings in 2121 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum