#include #include void handler(int signo) { printf(\"Into handler\\n\"); while(1); } int main() { struct sigaction act;
You can use something like this instead of printf:
const char *str = "Into handler\n"; write(1, str, strlen(str));
The function write(..) is safe to be called from signal hanlder. Don't forget to include unistd.h header to use it.
write(..)
unistd.h