https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83308
--- Comment #16 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> --- As for ioctl(): Linux: http://man7.org/linux/man-pages/man2/ioctl.2.html FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=ioctl&sektion=2 Plan9: https://github.com/brho/plan9/blob/master/sys/src/ape/lib/bsd/ioctl.c#L26 Darwin: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man2/ioctl.2.html So, I really think ioctl() should be declared in libgo/go/exp/terminal/util.go accordingly: //extern ioctl func ioctl(int, uint, unsafe.Pointer) int Shall I send a separate patch?