This should be more efficient everywhere, and appears to be
required on Solaris.
Copied from master repository.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201637
138bc75d-0d04-0410-961f-
82ee72b054a4
var hints syscall.Addrinfo
hints.Ai_flags = int32(cgoAddrInfoFlags())
+ hints.Ai_socktype = syscall.SOCK_STREAM
h := syscall.StringBytePtr(name)
syscall.Entersyscall()
}
}
for r := res; r != nil; r = r.Ai_next {
- // Everything comes back twice, once for UDP and once for TCP.
+ // We only asked for SOCK_STREAM, but check anyhow.
if r.Ai_socktype != syscall.SOCK_STREAM {
continue
}