Some POSIX functions are not threadsafe. Examples are dirname and pathname.
The dirname() function need not be reentrant. A function that is not required to be reentrant is not required to be thread-safe.
On some platforms there are reentrant versions of dirname and pathname: dirname_r and pathname_r. As far as I found out there are not reentrant version of dirname and pathname on Linux.
- Is that correct?
- What is the alternative?