Hi all,
i dont even know if this is even possible . but i m trying..
I have a Application A(by some company X). This application allows me to extend the functionality by allowing me to write my own functions(User written). I tell the Application A to call my user functions in the Applications A's configuration file(This is how it knows that Appl A must call user written Functions). The appl A uses Fucntion pointers which i must register with Application A,prior to calling my user written functions.
Now if there is a bug or fault in my user written functions in production, the Appl A will stop functioning, for e.g i have a segmentation fault in my User written fucntions.
So basically the Application A will load my user written function from a shared or DLL file. This means that my user written functions will be running in Application A' Process address space.
I wish to handle certain signals like Segmentaion fault, divide by zero and stack overflow.
But applications A has its own signal handlers written for this,
How can i write my own signal handlers to catch the exceptions in my user written functions, So that i can clean up grace fully w/o affecting much of Application A. Since my user functions will be called in Applications A's process , the OS will call signal handlers written in Application A and not my user functions.
How can i change this.I Want OS to call signal handlers written in my functions but only for signal raised by my functions, which is asynchronous in nature.
Note: i do not have source code of Application A and i cannot do any changes since its controlled by a different company.
I hope i m clear in writing my problem.
Sorry i didn't mention , I will be using C , and only C. platform : Linux, solaris and probably windows in future.