aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/exec_linux.go
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2019-12-28 14:45:35 +0100
committerTobias Klauser <tobias.klauser@gmail.com>2019-12-30 09:34:53 +0000
commit4b4370066f97ac40a4f095ca56a7b21a375aa5aa (patch)
tree766bfe10557e617961955327c57d2e25ac73c53f /src/syscall/exec_linux.go
parentdcd3b2c173b77d93be1c391e3b5f932e0779fb1f (diff)
downloadgo-4b4370066f97ac40a4f095ca56a7b21a375aa5aa.tar.xz
syscall: use fcntl64 on 32-bit GNU/Linux systems
Use fcntl64Syscall in forkAndExecInChild1 to get fcntl64 on 32-bit Linux systems. Updates #36211 Change-Id: Id0e34359256beace970e72102fdace7a987ff2b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/212598 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/syscall/exec_linux.go')
-rw-r--r--src/syscall/exec_linux.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go
index 3540d511bf..d639565b75 100644
--- a/src/syscall/exec_linux.go
+++ b/src/syscall/exec_linux.go
@@ -438,7 +438,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
if err1 != 0 {
goto childerror
}
- RawSyscall(SYS_FCNTL, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
+ RawSyscall(fcntl64Syscall, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
pipe = nextfd
nextfd++
}
@@ -451,7 +451,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
if err1 != 0 {
goto childerror
}
- RawSyscall(SYS_FCNTL, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
+ RawSyscall(fcntl64Syscall, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
fd[i] = nextfd
nextfd++
}
@@ -466,7 +466,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
if fd[i] == int(i) {
// dup2(i, i) won't clear close-on-exec flag on Linux,
// probably not elsewhere either.
- _, _, err1 = RawSyscall(SYS_FCNTL, uintptr(fd[i]), F_SETFD, 0)
+ _, _, err1 = RawSyscall(fcntl64Syscall, uintptr(fd[i]), F_SETFD, 0)
if err1 != 0 {
goto childerror
}