summaryrefslogtreecommitdiff
path: root/libgo/mksysinfo.sh
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-19 16:53:13 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-10-19 16:53:13 +0000
commit090dff108c2e12661a49851cfa76155b4898a7f3 (patch)
tree99ea1098649c175fe24c94394f1bd520f6c18770 /libgo/mksysinfo.sh
parente066ee667cec9a90478deff7b3090587ae11236f (diff)
runtime, syscall: force EPOLLET to be positive
The C definition is 1U << 31. Reportedly on some systems GCC's -fgo-dump-spec can print this as -2147483648. Reviewed-on: https://go-review.googlesource.com/31448 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/mksysinfo.sh')
-rwxr-xr-xlibgo/mksysinfo.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index f79b5cfd7d84..3640476a434d 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -185,7 +185,15 @@ fi
# epoll constants.
grep '^const _EPOLL' gen-sysinfo.go |
+ grep -v EPOLLET |
sed -e 's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+# Make sure EPOLLET is positive.
+if grep '^const _EPOLLET = [0-9]' gen-sysinfo.go; then
+ grep '^const _EPOLLET ' gen-sysinfo.go |
+ sed -e 's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+else
+ echo "const EPOLLET = 0x80000000" >> ${OUT}
+fi
# Make sure EPOLLRDHUP and EPOLL_CLOEXEC are defined.
if ! grep '^const EPOLLRDHUP' ${OUT} >/dev/null 2>&1; then
echo "const EPOLLRDHUP = 0x2000" >> ${OUT}