aboutsummaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2020-05-10 13:32:00 -0700
committerAndrew G. Morgan <morgan@kernel.org>2020-05-10 13:32:00 -0700
commitf88e342840faa27ba519cc89d3e39b936f4cce32 (patch)
tree0ebcc6aeedef75a7d2aaf739eb45079277c2444a /go
parent1f7f77c32e51e89f22ae271bae12b9103f28af2b (diff)
downloadplatform_external_libcap-f88e342840faa27ba519cc89d3e39b936f4cce32.tar.gz
platform_external_libcap-f88e342840faa27ba519cc89d3e39b936f4cce32.tar.bz2
platform_external_libcap-f88e342840faa27ba519cc89d3e39b936f4cce32.zip
Replace PerOSThreadSyscall*() with AllThreadsSyscall*().
The latest iteration of the golang patch [*] for supporting a syscall API that can normalize privilege over the whole runtime (aka POSIX semantics) has renamed this API. The API also now drops this functionality when CGO is enabled, but that doesn't affect libcap because libcap uses libpsx in this build configuration. [*] https://go-review.googlesource.com/c/go/+/210639/ Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'go')
-rwxr-xr-xgo/cgo-required.sh4
-rwxr-xr-xgo/syscalls.sh10
2 files changed, 7 insertions, 7 deletions
diff --git a/go/cgo-required.sh b/go/cgo-required.sh
index 5e7e98f..7551138 100755
--- a/go/cgo-required.sh
+++ b/go/cgo-required.sh
@@ -1,11 +1,11 @@
#!/bin/bash
#
-# Runtime check for whether or not syscall.PerOSThreadSyscall is
+# Runtime check for whether or not syscall.AllThreadsSyscall is
# available to the working go runtime or not. If it isn't we always
# have to use libcap/psx to get POSIX semantics for syscalls that
# change security state.
-if [ -z "$(go doc syscall 2>/dev/null|grep PerOSThreadSyscall)" ]; then
+if [ -z "$(go doc syscall 2>/dev/null|grep AllThreadsSyscall)" ]; then
echo "1"
else
echo "0"
diff --git a/go/syscalls.sh b/go/syscalls.sh
index 5affe11..9733d97 100755
--- a/go/syscalls.sh
+++ b/go/syscalls.sh
@@ -7,8 +7,8 @@ if [[ -z "$dir" ]]; then
fi
# We use one or the other syscalls.go file based on whether or not the
-# Go runtime include syscall.PerOSThreadSyscall or not.
-if [ -z "$(go doc syscall 2>/dev/null|grep PerOSThreadSyscall)" ]; then
+# Go runtime include syscall.AllThreadsSyscall or not.
+if [ -z "$(go doc syscall 2>/dev/null|grep AllThreadsSyscall)" ]; then
rm -f "${dir}/syscalls_cgo.go"
cat > "${dir}/syscalls.go" <<EOF
// +build linux
@@ -22,7 +22,7 @@ import (
// multisc provides syscalls overridable for testing purposes that
// support a single kernel security state for all OS threads.
-// (Go build tree has no syscall.PerOSThreadSyscall support.)
+// (Go build tree has no syscall.AllThreadsSyscall support.)
var multisc = &syscaller{
w3: psx.Syscall3,
w6: psx.Syscall6,
@@ -54,8 +54,8 @@ import "syscall"
// multisc provides syscalls overridable for testing purposes that
// support a single kernel security state for all OS threads.
var multisc = &syscaller{
- w3: syscall.PerOSThreadSyscall,
- w6: syscall.PerOSThreadSyscall6,
+ w3: syscall.AllThreadsSyscall,
+ w6: syscall.AllThreadsSyscall6,
r3: syscall.RawSyscall,
r6: syscall.RawSyscall6,
}