From: Ian Lance Taylor Date: Fri, 9 Nov 2018 15:29:15 +0000 (+0000) Subject: syscall: change RLIM_INFINITY from 0xffffffffffffffff to -1 X-Git-Tag: releases/gcc-7.4.0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a18d07f9685492460133692e800595eb4e083119;p=thirdparty%2Fgcc.git 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: r265972 --- diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index 2284928ae53a..3c2c2d2ad018 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -1088,7 +1088,20 @@ grep '^type _rlimit ' gen-sysinfo.go | \ grep '^const _RLIMIT_' gen-sysinfo.go | sed -e 's/^\(const \)_\(RLIMIT_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} 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 + 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. grep '^type _sysinfo ' gen-sysinfo.go | \