Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
syscall: make Getwd check $PWD on OS X #8400
On OS X, if you cd /tmp and call os.Getwd (which calls syscall.Getwd) it returns "/private/tmp". In Go 1.2 and earlier it returned "/tmp", because it used the "check $PWD, and then walk .. repeatedly" algorithm. CL 12349044 changed it to use getattrlist, so in Go 1.3 it returns "/private/tmp" (/tmp is a symlink to /private/tmp). The C library routine getwd returns "/tmp". I know this because liblink in C sees "/tmp" and liblink in Go sees "/private/tmp". I think we should probably add the $PWD check to OS X's syscall.Getwd (or else move it up above the ImplementsGetwd check in package os's Getwd, but changing OS X alone is the more conservative change). CL 118970043 does this. We just have to decide if that's what we want to do.