golang error: reference to undefined identifier ‘syscall.TUNSETIFF’

golang error: reference to undefined identifier ‘syscall.TUNSETIFF’

所以,我一直在尝试用 gccgo 构建 flannel (https://github.com/coreos/flannel)。这是我在构建时遇到的错误:

$ ./build 
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
  err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
                                     ^

我正在使用 gccgo-5 和 gcc-5。谁能帮我弄清楚这里到底是什么问题? TIA

所以,我找到了答案。问题是 gccgo 没有为我的 arch 定义 TUNSETIFF。我相应地定义了这个值,并且我能够让它发挥作用。谢谢@JimB