diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-09-26 15:17:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-09-26 15:17:30 +0000 |
commit | dd554b787d0280566e891dba9e19dd718e68d42a (patch) | |
tree | 57f5e1807370604954ab0338603cc0503a68178b | |
parent | 6693898454936b07c7e003de872149b4201e940c (diff) | |
download | gcc-dd554b787d0280566e891dba9e19dd718e68d42a.zip gcc-dd554b787d0280566e891dba9e19dd718e68d42a.tar.gz gcc-dd554b787d0280566e891dba9e19dd718e68d42a.tar.bz2 |
syscall: don't assume we have a GETEUID system call
On Alpha GNU/Linux there is no geteuid system call, there is only
getresuid. The raw geteuid system call is only used for testing, so
just skip the test if it's not available.
Reviewed-on: https://go-review.googlesource.com/137655
From-SVN: r264647
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | libgo/go/syscall/syscall_linux_test.go | 4 | ||||
-rwxr-xr-x | libgo/mksysinfo.sh | 6 |
3 files changed, 11 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index c306628..8cb370f 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -e7b98cf0a380eb45791cd5c52897224a686dcdec +944784a93cf89d3a238e5607c993ea5f18f99c12 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/syscall/syscall_linux_test.go b/libgo/go/syscall/syscall_linux_test.go index 99de6eb..77a822d 100644 --- a/libgo/go/syscall/syscall_linux_test.go +++ b/libgo/go/syscall/syscall_linux_test.go @@ -302,6 +302,10 @@ func TestSyscallNoError(t *testing.T) { t.Skip("skipping root only test") } + if syscall.Sys_GETEUID == 0 { + t.Skip("skipping because there is no geteuid system call") + } + // Copy the test binary to a location that a non-root user can read/execute // after we drop privileges tempDir, err := ioutil.TempDir("", "TestSyscallNoError") diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index b9436ef..b7b9fdc 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -138,6 +138,12 @@ if ! grep '^const SYS_GETDENTS64 ' ${OUT} >/dev/null 2>&1; then echo "const SYS_GETDENTS64 = 0" >> ${OUT} fi +# The syscall package wants the geteuid system call number. It isn't +# defined on Alpha, which only provides the getresuid system call. +if ! grep '^const SYS_GETEUID ' ${OUT} >/dev/null 2>&1; then + echo "const SYS_GETEUID = 0" >> ${OUT} +fi + # Stat constants. grep '^const _S_' gen-sysinfo.go | \ sed -e 's/^\(const \)_\(S_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} |