aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-11-09 15:30:51 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-11-09 15:30:51 +0000
commit71caffb725450df820f706dc8f7a05aa8a22061f (patch)
tree4e5710fb533d2b4686a53adfc2b26b6d1f18292a /libgo
parent0b58e8b8cea3ca18e6dddc28546109019b699138 (diff)
downloadgcc-71caffb725450df820f706dc8f7a05aa8a22061f.zip
gcc-71caffb725450df820f706dc8f7a05aa8a22061f.tar.gz
gcc-71caffb725450df820f706dc8f7a05aa8a22061f.tar.bz2
syscall: change RLIM_INFINITY from 0xffffffffffffffff to -1
For compatibility with the gc toolchain's syscall package. Fixes golang/go#28665 Reviewed-on: https://go-review.googlesource.com/c/148697 From-SVN: r265974
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/mksysinfo.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index b7b9fdc..2fa7aff 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -1152,10 +1152,17 @@ grep '^const _RLIMIT_' gen-sysinfo.go |
grep '^const _RLIM_' gen-sysinfo.go |
grep -v '^const _RLIM_INFINITY ' |
sed -e 's/^\(const \)_\(RLIM_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+rliminf=""
if test "${rlimit}" = "_rlimit64" && grep '^const _RLIM64_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then
- echo 'const RLIM_INFINITY = _RLIM64_INFINITY' >> ${OUT}
-elif grep '^const _RLIM_INFINITY ' gen-sysinfo.go > /dev/null 2>&1; then
- echo 'const RLIM_INFINITY = _RLIM_INFINITY' >> ${OUT}
+ rliminf=`grep '^const _RLIM64_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'`
+else
+ rliminf=`grep '^const _RLIM_INFINITY ' gen-sysinfo.go | sed -e 's/.* //'`
+fi
+# For compatibility with the gc syscall package, treat 0xffffffffffffffff as -1.
+if test "$rliminf" = "0xffffffffffffffff"; then
+ echo "const RLIM_INFINITY = -1" >> ${OUT}
+elif test -n "$rliminf"; then
+ echo "const RLIM_INFINITY = $rliminf" >> ${OUT}
fi
# The sysinfo struct.