Re:Linux Namespaces and Go Don't Mix
by the_mitsuhiko on Saturday June 03, 2017 @08:22AM
(#14476058)
It's not true on macOS either. Threads can have different working directories for instance.
[ Parent
| on HN ]
I'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/aa3...
Re:Linux Namespaces and Go Don't Mix
by the_mitsuhiko on Saturday June 03, 2017 @01:45PM
(#14477474)
SYS___pthread_chdir exists on mac os.