Skip to content

Commit

Permalink
internal/poll: use fcntl64 on 32-bit GNU/Linux systems
Browse files Browse the repository at this point in the history
Use FcntlSyscall from internal/syscall/unix to get fcntl64 on 32-bit
Linux systems.

Updates #36211

Change-Id: If48a6e09606ca9f7f6e22f3e8dc9a25fb3ccaf65
Reviewed-on: https://go-review.googlesource.com/c/go/+/212537
Run-TryBot: Tobias Klauser <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
tklauser committed Dec 26, 2019
1 parent c170b14 commit 075c20c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/go/build/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var pkgDeps = map[string][]string{
},

"internal/cfg": {"L0"},
"internal/poll": {"L0", "internal/oserror", "internal/race", "syscall", "time", "unicode/utf16", "unicode/utf8", "internal/syscall/windows"},
"internal/poll": {"L0", "internal/oserror", "internal/race", "syscall", "time", "unicode/utf16", "unicode/utf8", "internal/syscall/windows", "internal/syscall/unix"},
"internal/testlog": {"L0"},
"os": {"L1", "os", "syscall", "time", "internal/oserror", "internal/poll", "internal/syscall/windows", "internal/syscall/unix", "internal/testlog"},
"path/filepath": {"L2", "os", "syscall", "internal/syscall/windows"},
Expand Down
3 changes: 2 additions & 1 deletion src/internal/poll/splice_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package poll

import (
"internal/syscall/unix"
"sync/atomic"
"syscall"
"unsafe"
Expand Down Expand Up @@ -169,7 +170,7 @@ func newTempPipe() (prfd, pwfd int, sc string, err error) {
defer atomic.StorePointer(&disableSplice, unsafe.Pointer(p))

// F_GETPIPE_SZ was added in 2.6.35, which does not have the -EAGAIN bug.
if _, _, errno := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fds[0]), syscall.F_GETPIPE_SZ, 0); errno != 0 {
if _, _, errno := syscall.Syscall(unix.FcntlSyscall, uintptr(fds[0]), syscall.F_GETPIPE_SZ, 0); errno != 0 {
*p = true
destroyTempPipe(fds[0], fds[1])
return -1, -1, "fcntl", errno
Expand Down

0 comments on commit 075c20c

Please sign in to comment.