diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-19 05:09:43 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-01-19 05:09:43 +0000 |
commit | 0a76ba3c43bb8c4686692d71c962354683c29890 (patch) | |
tree | e0cc622cbd4c4d744c92f6dac58a662fa7612928 /libgo | |
parent | 1817a7d93a4e3985005c7639b30f019d0e1f3b71 (diff) |
mksysinfo: use rlimit64 if available when we use getrlimit64
This makes no difference on most systems, because <sys/resource.h>
renames the type appropriately anyhow, but apparently it makes a
difference on AIX.
Reviewed-on: https://go-review.googlesource.com/88076
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256877 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/Makefile.am | 2 | ||||
-rw-r--r-- | libgo/Makefile.in | 2 | ||||
-rwxr-xr-x | libgo/mksysinfo.sh | 18 |
3 files changed, 18 insertions, 4 deletions
diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 16ccf9caa13..88be5dbb00a 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -674,7 +674,7 @@ s-errno: sysinfo.go: s-sysinfo; @true s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i - GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh + GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go $(STAMP) $@ diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 7a02fa64029..471a047f831 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -3241,7 +3241,7 @@ s-errno: sysinfo.go: s-sysinfo; @true s-sysinfo: $(srcdir)/mksysinfo.sh gen-sysinfo.go errno.i - GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh + GOARCH=$(GOARCH) GOOS=$(GOOS) $(SHELL) $(srcdir)/mksysinfo.sh $(SHELL) $(srcdir)/mvifdiff.sh tmp-sysinfo.go sysinfo.go $(STAMP) $@ diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index a384e401154..6f7cba72494 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -1120,8 +1120,16 @@ if test "$timex" != ""; then fi # The rlimit struct. -grep '^type _rlimit ' gen-sysinfo.go | \ - sed -e 's/_rlimit/Rlimit/' \ +# On systems that use syscall/libcall_posix_largefile.go, use rlimit64 +# if it exists. +rlimit="_rlimit" +if test "${GOOS}" = "aix" || test "${GOOS}" = "linux" || (test "${GOOS}" = "solaris" && (test "${GOARCH}" = "386" || test "${GOARCH}" = "sparc")); then + if grep '^type _rlimit64 ' gen-sysinfo.go > /dev/null 2>&1; then + rlimit="_rlimit64" + fi +fi +grep "^type ${rlimit} " gen-sysinfo.go | \ + sed -e "s/${rlimit}/Rlimit/" \ -e 's/rlim_cur/Cur/' \ -e 's/rlim_max/Max/' \ >> ${OUT} @@ -1130,7 +1138,13 @@ 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} +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; then + echo 'const RLIM_INFINITY = _RLIM_INFINITY' >> ${OUT} +fi # The sysinfo struct. grep '^type _sysinfo ' gen-sysinfo.go | \ |