Newlib signal handling mechanism

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Newlib signal handling mechanism

Post by JamesM »

I'm trying to implement signal handling. I've got kernel functions that deal with it but I want to wrap these in a posix-like fashion.

I noticed that newlib defines raise() and signal() - raise just calls kill(), and sends a signal, signal() changes the handler for a signal.

My question is - what the hell should I do when I recieve a signal?! How do I query newlib to find out what the handler function for that signal is? POSIX defines sigaction for this, but I can't see it defined in the newlib headers (only when _POSIX_REALTIME_SIGNALS is defined, and I don't want to define that!)

Does anyone know how this is supposed to be done? Am I supposed to override all the sigset/sigaction/sigismember etc funcs myself? and if so what is the point in newlibs signal handling functions anyway?

JamesM
Post Reply