For Linux, look at the manpage for signal(7). There is a list of async-signal-safe functions. It says:
POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) requires an implementation to guarantee that the following functions can be safely called inside a signal handler:
signal()
is in the list. So it's safe.