Backport a patch just committed to gc tip. There is a bug report on the golang-dev mailing list (https://groups.google.com/d/msg/golang-dev/sDg-t1_DPw0/-AJmLxgPBQAJ) in which waitid running on MIPS returns EFAULT, and this patch may fix the problem. Bootstrapped and ran Go tests on x86_64-pc-linux-gnu. Committed to mainline and GCC 7 branch. Ian