As a general rule, functions that use only local variables are reentrant-safe; any usage of a global or a static data renders them unsafe. This is a key point: you can only call those functions in a signal handler that are documented as being reentrant-safe or signal-async-safe.
The man page on signal-safety(7) http://man7.org/linux/man-pages/man7/signal-safety.7.html provides details for this.
Among them, it publishes a list of (alphabetically ordered) functions that the POSIX.1 standard requires an implementation to guarantee are implemented as being async-signal-safe, (See man page version ...