mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-30 22:06:37 -04:00
unix: change Dup,Dup2,Dup3 to use Syscall, not RawSyscall
This avoids hanging when a Go program uses a FUSE filesystem and the dup system call has to close a file descriptor. When dup uses RawSyscall then the goroutine calling dup will occupy a scheduler slot (a p structure) during the call, and may block waiting for some other goroutine to respond to the close call on the FUSE filesystem. Changing to Syscall avoids the problem. This makes Dup a tiny bit slower but is quite unlikely to make a difference for any real programs. Update golang/go#10202. Change-Id: I590c5c9a04e0a1281a85dc553c7592fa83949ac7 Reviewed-on: https://go-review.googlesource.com/8056 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
@@ -790,9 +790,9 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys Close(fd int) (err error)
|
||||
//sys Creat(path string, mode uint32) (fd int, err error)
|
||||
//sysnb Dup(oldfd int) (fd int, err error)
|
||||
//sysnb Dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb Dup3(oldfd int, newfd int, flags int) (err error)
|
||||
//sys Dup(oldfd int) (fd int, err error)
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sysnb EpollCreate1(flag int) (fd int, err error)
|
||||
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
||||
|
||||
Reference in New Issue
Block a user