summaryrefslogtreecommitdiff
path: root/libgo/mksysinfo.sh
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/mksysinfo.sh')
-rwxr-xr-xlibgo/mksysinfo.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index e29febfa619..17661361b38 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -118,6 +118,22 @@ grep '^const _SYS_' gen-sysinfo.go | \
echo "const $sup = _$sys" >> ${OUT}
done
+# Handle system call numbers like "(0x40000000 | (234))"
+if grep '^// unknowndefine SYS_[a-z]' gen-sysinfo.go >/dev/null 2>&1; then
+ rm -f unknown-syscalls.c
+ echo "#include \"sysinfo.c\"" > unknown-syscalls.c
+ grep '^// unknowndefine SYS_[a-z]' gen-sysinfo.go | \
+ grep __NR_ | \
+ awk '{ print $3 }' | \
+ while read sys; do
+ sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
+ echo "const $sup = $sys"
+ done >> unknown-syscalls.c
+ ${CC} -E unknown-syscalls.c | \
+ grep "^const SYS_.*=" | \
+ grep -v __NR_ >> ${OUT}
+fi
+
# Stat constants.
grep '^const _S_' gen-sysinfo.go | \
sed -e 's/^\(const \)_\(S_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}