I am now porting an single-threaded library to support multi-threads, and I need the whole list of functions that use local static or global variables.
Any information is appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Check the manual page for each function you use … the non-thread-safe ones will be identified as such, and the manual page will mention a thread safe version when there is one (e.g.,
readdir_r). You could extract the list by running a script over the man pages.Edit: Although my answer has been accepted, I fear that it is inaccurate and possibly dangerous. For example, while strerror_r mentions that it is a thread safe version of strerror, strerror itself says nothing about thread safety … what it says instead is “the string might be overwritten”, which merely implies that it isn’t thread-safe. So you need to search for at least “might be overwritten” as well as “thread”, but there’s no guarantee that even that will be complete.