aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_plan9.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/syscall_plan9.go')
-rw-r--r--src/syscall/syscall_plan9.go33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/syscall/syscall_plan9.go b/src/syscall/syscall_plan9.go
index ca286c8c97..92414709ef 100644
--- a/src/syscall/syscall_plan9.go
+++ b/src/syscall/syscall_plan9.go
@@ -13,6 +13,7 @@ package syscall
import (
"internal/oserror"
+ "runtime"
"unsafe"
)
@@ -301,7 +302,9 @@ func Await(w *Waitmsg) (err error) {
}
func Unmount(name, old string) (err error) {
- fixwd(name, old)
+ if fixwd(name, old) {
+ defer runtime.UnlockOSThread()
+ }
oldp, err := BytePtrFromString(old)
if err != nil {
return err
@@ -384,49 +387,63 @@ func Getgroups() (gids []int, err error) {
//sys open(path string, mode int) (fd int, err error)
func Open(path string, mode int) (fd int, err error) {
- fixwd(path)
+ if fixwd(path) {
+ defer runtime.UnlockOSThread()
+ }
return open(path, mode)
}
//sys create(path string, mode int, perm uint32) (fd int, err error)
func Create(path string, mode int, perm uint32) (fd int, err error) {
- fixwd(path)
+ if fixwd(path) {
+ defer runtime.UnlockOSThread()
+ }
return create(path, mode, perm)
}
//sys remove(path string) (err error)
func Remove(path string) error {
- fixwd(path)
+ if fixwd(path) {
+ defer runtime.UnlockOSThread()
+ }
return remove(path)
}
//sys stat(path string, edir []byte) (n int, err error)
func Stat(path string, edir []byte) (n int, err error) {
- fixwd(path)
+ if fixwd(path) {
+ defer runtime.UnlockOSThread()
+ }
return stat(path, edir)
}
//sys bind(name string, old string, flag int) (err error)
func Bind(name string, old string, flag int) (err error) {
- fixwd(name, old)
+ if fixwd(name, old) {
+ defer runtime.UnlockOSThread()
+ }
return bind(name, old, flag)
}
//sys mount(fd int, afd int, old string, flag int, aname string) (err error)
func Mount(fd int, afd int, old string, flag int, aname string) (err error) {
- fixwd(old)
+ if fixwd(old) {
+ defer runtime.UnlockOSThread()
+ }
return mount(fd, afd, old, flag, aname)
}
//sys wstat(path string, edir []byte) (err error)
func Wstat(path string, edir []byte) (err error) {
- fixwd(path)
+ if fixwd(path) {
+ defer runtime.UnlockOSThread()
+ }
return wstat(path, edir)
}