summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 21:43:49 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 21:43:49 +0000
commitf9d9cae7c6542bc91a6c8acfe52936712caed99c (patch)
tree81d125d87d956016a16dc2bf4d8042a86cee900f
parent23c1ecacd7efa88b0a2c14fceafa7f2bd6173119 (diff)
downloadgcc-f9d9cae7c6542bc91a6c8acfe52936712caed99c.tar.gz
mksysinfo: backport patches from trunk
Backports the following changes from trunk: https://golang.org/cl/17893 https://golang.org/cl/16588 https://golang.org/cl/16580 https://golang.org/cl/16534 https://golang.org/cl/14858 The patch was put together by Lynn Boger. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@232849 138bc75d-0d04-0410-961f-82ee72b054a4
-rwxr-xr-xlibgo/mksysinfo.sh27
1 files changed, 25 insertions, 2 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index 57d4a038e76..9062c2c9236 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -183,6 +183,12 @@ enum {
#ifdef TIOCSCTTY
TIOCSCTTY_val = TIOCSCTTY,
#endif
+#ifdef TIOCGPGRP
+ TIOCGPGRP_val = TIOCGPGRP,
+#endif
+#ifdef TIOCSPGRP
+ TIOCSPGRP_val = TIOCSPGRP,
+#endif
#ifdef TIOCGPTN
TIOCGPTN_val = TIOCGPTN,
#endif
@@ -534,7 +540,7 @@ upcase_fields () {
# GNU/Linux specific; it should do no harm if there is no
# _user_regs_struct.
regs=`grep '^type _user_regs_struct struct' gen-sysinfo.go || true`
-if test "$regs" == ""; then
+if test "$regs" = ""; then
# s390
regs=`grep '^type __user_regs_struct struct' gen-sysinfo.go || true`
if test "$regs" != ""; then
@@ -878,11 +884,13 @@ grep '^type _addrinfo ' gen-sysinfo.go | \
-e 's/ ai_/ Ai_/g' \
>> ${OUT}
-# The addrinfo flags and errors.
+# The addrinfo and nameinfo flags and errors.
grep '^const _AI_' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(AI_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
grep '^const _EAI_' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(EAI_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+grep '^const _NI_' gen-sysinfo.go | \
+ sed -e 's/^\(const \)_\(NI_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
# The passwd struct.
grep '^type _passwd ' gen-sysinfo.go | \
@@ -918,6 +926,16 @@ if ! grep '^const TIOCSCTTY' ${OUT} >/dev/null 2>&1; then
echo 'const TIOCSCTTY = _TIOCSCTTY_val' >> ${OUT}
fi
fi
+if ! grep '^const TIOCGPGRP' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCGPGRP_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCGPGRP = _TIOCGPGRP_val' >> ${OUT}
+ fi
+fi
+if ! grep '^const TIOCSPGRP' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCSPGRP_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCSPGRP = _TIOCSPGRP_val' >> ${OUT}
+ fi
+fi
if ! grep '^const TIOCGPTN' ${OUT} >/dev/null 2>&1; then
if grep '^const _TIOCGPTN_val' ${OUT} >/dev/null 2>&1; then
echo 'const TIOCGPTN = _TIOCGPTN_val' >> ${OUT}
@@ -1433,6 +1451,11 @@ grep '^type _inotify_event ' gen-sysinfo.go | \
# The GNU/Linux CLONE flags.
grep '^const _CLONE_' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(CLONE_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+# We need some CLONE constants that are not defined in older versions
+# of glibc.
+if ! grep '^const CLONE_NEWUSER ' ${OUT} > /dev/null 2>&1; then
+ echo "const CLONE_NEWUSER = 0x10000000" >> ${OUT}
+fi
# Struct sizes.
set cmsghdr Cmsghdr ip_mreq IPMreq ip_mreqn IPMreqn ipv6_mreq IPv6Mreq \