Michael Haggerty [off-list ref] writes:
If I understand you correctly, the use of some API routines requires a
chdir by the caller (i.e., the surrounding application) *before* calling
into the routine. This is certainly a bit cleaner than the library
chdiring itself, but it is still unusable in a multithreaded context.
Why?
Presumably you know what your threads are doing, so if you take input from
the end user after you started the environment, you will be doing the
prefix discovery and pathspec prefixing on the entry and prefix stripping
upon output but do not have to (and should not be doing) chdir at all.