Skip to content

Commit 4b43700

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent dcd3b2c commit 4b43700

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/syscall/exec_linux.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
438438
if err1 != 0 {
439439
goto childerror
440440
}
441-
RawSyscall(SYS_FCNTL, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
441+
RawSyscall(fcntl64Syscall, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
442442
pipe = nextfd
443443
nextfd++
444444
}
@@ -451,7 +451,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
451451
if err1 != 0 {
452452
goto childerror
453453
}
454-
RawSyscall(SYS_FCNTL, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
454+
RawSyscall(fcntl64Syscall, uintptr(nextfd), F_SETFD, FD_CLOEXEC)
455455
fd[i] = nextfd
456456
nextfd++
457457
}
@@ -466,7 +466,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att
466466
if fd[i] == int(i) {
467467
// dup2(i, i) won't clear close-on-exec flag on Linux,
468468
// probably not elsewhere either.
469-
_, _, err1 = RawSyscall(SYS_FCNTL, uintptr(fd[i]), F_SETFD, 0)
469+
_, _, err1 = RawSyscall(fcntl64Syscall, uintptr(fd[i]), F_SETFD, 0)
470470
if err1 != 0 {
471471
goto childerror
472472
}

0 commit comments

Comments
 (0)