summaryrefslogtreecommitdiff
path: root/libgo/mksysinfo.sh
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-09-26 15:17:30 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-09-26 15:17:30 +0000
commitdd554b787d0280566e891dba9e19dd718e68d42a (patch)
tree57f5e1807370604954ab0338603cc0503a68178b /libgo/mksysinfo.sh
parent6693898454936b07c7e003de872149b4201e940c (diff)
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
Diffstat (limited to 'libgo/mksysinfo.sh')
-rwxr-xr-xlibgo/mksysinfo.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index b9436ef1e83..b7b9fdcc5b0 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}