Page 1 of 1

Newlib signals

Posted: Wed Mar 22, 2017 2:58 pm
by Agola
Hi.

I'm working on signaling on newlib. But interestingly I couldn't find I way to signal except raise. Is there a way that I don't know to signal a task?
I don't think newlib implementation of signal only support the signal and raise.

If newlib implementation of signal only supports the signal and raise, it should be impossible send signals from kill syscall. But it's defined.
Again if it only supports signal and raise, how can I handle signals to be sent from kill?

Thanks in advance.

Re: Newlib signals

Posted: Wed Mar 22, 2017 3:20 pm
by max
Hey,

I'm not sure if I understand your question correctly, but usually a signal is only raised in the own process using raise and sent to other processes using kill.

The signal implementation provided by Newlib is basically just an emulation (works only within the current process). You will have to implement real signal handling in your kernel. (http://wiki.osdev.org/Porting_Newlib#Signal_handling). It takes quite some work to implement it; the state of the interrupted process must be stored, the appropriate signal handler called in user space and then the old state must be restored once the signal handler has finished it's work.

Greets