summaryrefslogtreecommitdiff
path: root/libgo/mksysinfo.sh
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-20 00:18:15 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-20 00:18:15 +0000
commit84911de8492fb75007eec6bfa4abb7905439f93c (patch)
treec891bdec1e6f073f73fedeef23718bc3ac30d499 /libgo/mksysinfo.sh
parentad33e6a8510b48571eaef50af339892925108830 (diff)
downloadgcc-84911de8492fb75007eec6bfa4abb7905439f93c.tar.gz
Update to current version of Go library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/mksysinfo.sh')
-rwxr-xr-xlibgo/mksysinfo.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index fecaeb6b312..19885fb000d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -74,6 +74,8 @@ cat > sysinfo.c <<EOF
#include <sys/select.h>
#endif
#include <unistd.h>
+#include <netdb.h>
+#include <pwd.h>
EOF
${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c
@@ -403,6 +405,10 @@ else
echo "type Rusage struct {}" >> ${OUT}
fi
+# The RUSAGE constants.
+grep '^const _RUSAGE_' gen-sysinfo.go | \
+ sed -e 's/^\(const \)_\(RUSAGE_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+
# The utsname struct.
grep '^type _utsname ' gen-sysinfo.go | \
sed -e 's/_utsname/Utsname/' \
@@ -456,4 +462,20 @@ if test "$fd_set" != ""; then
fi
echo "type fds_bits_type $fds_bits_type" >> ${OUT}
+# The addrinfo struct.
+grep '^type _addrinfo ' gen-sysinfo.go | \
+ sed -e 's/_addrinfo/Addrinfo/g' \
+ -e 's/ ai_/ Ai_/g' \
+ >> ${OUT}
+
+# The addrinfo flags.
+grep '^const _AI_' gen-sysinfo.go | \
+ sed -e 's/^\(const \)_\(AI_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+
+# The passwd struct.
+grep '^type _passwd ' gen-sysinfo.go | \
+ sed -e 's/_passwd/Passwd/' \
+ -e 's/ pw_/ Pw_/g' \
+ >> ${OUT}
+
exit $?