syscall: always define WEXITED and WNOWAIT on GNU/Linux

Fixes https://gcc.gnu.org/PR88135

Change-Id: I467e4df03790f962c627e77bcf7d07a49e688e23
Reviewed-on: https://go-review.googlesource.com/c/150897
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh
index d4286dc..02f0b5b 100755
--- a/libgo/mksysinfo.sh
+++ b/libgo/mksysinfo.sh
@@ -173,6 +173,15 @@
    && ! grep '^const _WALL = ' gen-sysinfo.go >/dev/null 2>&1; then
   echo 'const WALL = ___WALL' >> ${OUT}
 fi
+# On GNU/Linux the os package requires WEXITED and WNOWAIT.
+if test "${GOOS}" = "linux"; then
+  if ! grep '^const WEXITED = ' ${OUT} >/dev/null 2>&1; then
+    echo 'const WEXITED = 4' >> ${OUT}
+  fi
+  if ! grep '^const WNOWAIT = ' ${OUT} >/dev/null 2>&1; then
+    echo 'const WNOWAIT = 0x01000000' >> ${OUT}
+  fi
+fi
 
 # Networking constants.
 egrep '^const _(AF|ARPHRD|ETH|IN|SOCK|SOL|SO|IPPROTO|TCP|IP|IPV6)_' gen-sysinfo.go |