Added simple signal handling.
Added error handling to poll(2).
When poll(2) returns with -1, a MIML function is called.