Given the restricted environment that a signal handler is (you can only use safely a set of functions), the registered function should be unsafe.
For a list of safe functions see the "Async-signal-safe functions" section in http://man7.org/linux/man-pages/man7/signal.7.html