Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ptsname() for big-endian architectures (again)
This reverts commit f1b333f (Use Ioctl{SetPointerInt,GetInt} from golang.org/x/sys/unix on linux), changing the code to what it was after commit dbd69c5. This fixes a blocker bug on s390. The original description from commit dbd69c5 follows: On big-endian architectures unix.IoctlGetInt() leads to a wrong result because a 32 bit value is stored into a 64 bit buffer. When dereferencing the result is left shifted by 32. Without this patch ptsname() returns a wrong path from the second pty onwards. To protect syscalls against re-arranging by the GC the conversion from unsafe.Pointer to uintptr must occur in the Syscall expression itself. See the documentation of the unsafe package for details. Cc: Peter Morjan <[email protected]> Cc: Tobias Klauser <[email protected]> Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information