3 ms·
It's not true on macOS either. Threads can have different working directories for instance.
by the_mitsuhiko 9y ago
It's not true on macOS either. Threads can have different working directories for instance.
- bboreham 9y agoI'd be interested to know how to do that. Go's Chdir() calls SYS_CHDIR on Darwin, and Posix requires that chdir affects the whole process. In Linux you can unset CLONE_FS when creating a thread, but the Go runtime does not do this. I note the Windows docs[1] say "Multithreaded applications and shared library code should not use the SetCurrentDirectory function" (which Go's Chdir() calls) [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa365530(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...
- the_mitsuhiko 9y agoSYS___pthread_chdir exists on mac os.