]> Cypherpunks repositories - gostls13.git/commit
syscall: make pwd process-wide on Plan 9
authorBrad Fitzpatrick <bradfitz@golang.org>
Sat, 28 Feb 2015 03:34:56 +0000 (19:34 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Sat, 28 Feb 2015 18:17:35 +0000 (18:17 +0000)
commitbc9748ee6bfba3632ab9c98c8dd475d8eacf41b3
treeb4d2ac0050e33e862b24a0bb5dac35ebc33df480
parent2adc3bd6ef84aa8b3d730f5d0d96a30427f2ecc2
syscall: make pwd process-wide on Plan 9

On Plan 9, the pwd is apparently per-thread not per process. That
means different goroutines saw different current directories, even
changing within a goroutine as they were scheduled.

Instead, track the the process-wide pwd protected by a mutex in the
syscall package and set the current goroutine thread's pwd to the
correct once at critical points.

Fixes #9428

Change-Id: I928e90886355be4a95c2be834f5883e2b50fc0cf
Reviewed-on: https://go-review.googlesource.com/6350
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/syscall/env_plan9.go
src/syscall/exec_plan9.go
src/syscall/pwd_plan9.go [new file with mode: 0644]
src/syscall/syscall_plan9.go
src/syscall/zsyscall_plan9_386.go
src/syscall/zsyscall_plan9_amd64.go