diff options
| author | Andrew G. Morgan <agm@google.com> | 2020-10-28 13:35:57 -0700 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2020-10-29 17:53:57 +0000 |
| commit | 3a819e8998af1db3bdd34eb2ab059a3c534c6def (patch) | |
| tree | 8fd6d218b9b85f82dab1ada0c9ca9699ba0ee6b0 /src/syscall/syscall_linux_mipsx.go | |
| parent | 4fb429138881e3fe171e4c2e958ed0da26ddfd9c (diff) | |
| download | go-3a819e8998af1db3bdd34eb2ab059a3c534c6def.tar.xz | |
syscall: handle undefined r2 value on linux-ppc64x
This change fixes two failng tests on linux-ppc64x:
- TestAllThreadsSyscall() exposed a real bug in the ppc64x support:
- It turns out that the r2 syscall return value is not defined
on all architectures. Notably linux-ppc64x so address that by
introducing a private architectural constant in the syscall
package, archHonorsR2: true if r2 has a determanistic value.
- TestSetuidEtc() was sensitive to /proc/<PID>/status content:
- The amount of padding space has changed with kernel vintage.
- Stress testing revealed a race with /proc files disappearing.
Fixes #42178
Change-Id: Ie6fc0b8f2f94a409ac0e5756e73bfce113274709
Reviewed-on: https://go-review.googlesource.com/c/go/+/266202
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/syscall/syscall_linux_mipsx.go')
| -rw-r--r-- | src/syscall/syscall_linux_mipsx.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/syscall/syscall_linux_mipsx.go b/src/syscall/syscall_linux_mipsx.go index 5126b0e43c..377946fc92 100644 --- a/src/syscall/syscall_linux_mipsx.go +++ b/src/syscall/syscall_linux_mipsx.go @@ -9,6 +9,12 @@ package syscall import "unsafe" +// archHonorsR2 captures the fact that r2 is honored by the +// runtime.GOARCH. Syscall conventions are generally r1, r2, err := +// syscall(trap, ...). Not all architectures define r2 in their +// ABI. See "man syscall". +const archHonorsR2 = true + const _SYS_setgroups = SYS_SETGROUPS func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) |
