I'm developing a C99 multi-threaded Linux program, and I have several threads that run third party code. So, I want to be able to handle SIGSEGV in order to exit the problematic thread and give other threads the chance to finish nicelly and, finally, exit the program.
I know that errno is thread-safe. And in Linux, there are another 2 similar functions, namely strerror and strerror_r. According to the book Linux System Programming by Robert Lover, strerror is not thread-safe but strerror_r is. So I am wondering if perror is thread-safe or not.
I am trying to install fwbackups on linux mint. I get this error:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive...
I have read at many places that a thread-safe function is always reentrant, but a reentrant function is not always thread-safe.
I understand the second part that reentrant function is not always thread-safe, since the reentrant function works on each of the thread's local data and so if the reentrant function is accessing any global data in it then it cannot be threadsafe.