Are regular expressions like "regexec" thread safe in libc version 2.2.5?

I read that regular expressions in libc should be thread safe, but I also read that this was not the case in an earlier version.

Now I need to work with an embedded system that has an old version of libc version 2.2.5.

So, I'm not sure if functions like "regexec" are thread safe or if they should be protected by a mutex?

If someone tells me about this, I will be grateful. I am also not very sure what I should check in order to check the thread safety of these functions.

+4
source share
1 answer

I searched the NEWS file in the latest libc (2.13) version for the regex keyword. There is nothing in thread safety, but the following note:

Version 2.3 ... Isamu Hasegawa contributed a completely new and POSIX-conformant implementation of regex. 

But according to this , after version 2.3 there was a problem with concurrency, so everything does not look so good for 2.2.5

According to this very similar question POSIX correspondence means that regexec should be thread safe, but that does not mean that there is no libc in the earlier version of concurrency error.

+2
source

All Articles