]> Cypherpunks repositories - gostls13.git/commit
net: use libc (not cgo) for DNS on macOS
authorRuss Cox <rsc@golang.org>
Fri, 28 Oct 2022 14:54:37 +0000 (10:54 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 1 Nov 2022 14:05:39 +0000 (14:05 +0000)
commita3559f3301b54468c14d4997af0d617db60f4915
tree3246f85a010cc7b0edff477db3b3514278e7bc4e
parent661e931dd120484cc1318792bc93ace00bbde088
net: use libc (not cgo) for DNS on macOS

Change the macOS implementation to use libc calls.
Using libc calls directly is what we do for all the runtime and os syscalls.
Doing so here as well improves consistency and also makes it possible
to cross-compile (from non-Mac systems) macOS binaries that use the
native name resolver.

Fixes #12524.

Change-Id: I011f4fcc5c50fbb5396e494889765dcbb9342336
Reviewed-on: https://go-review.googlesource.com/c/go/+/446178
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/internal/syscall/unix/asm_darwin.s
src/internal/syscall/unix/getentropy_darwin.go
src/internal/syscall/unix/net_darwin.go [new file with mode: 0644]
src/net/cgo_resnew.go
src/net/cgo_sockold.go
src/net/cgo_unix.go
src/net/cgo_unix_cgo.go [new file with mode: 0644]
src/net/cgo_unix_syscall.go [new file with mode: 0644]
src/runtime/sys_darwin.go
src/runtime/sys_darwin_amd64.s
src/runtime/sys_darwin_arm64.s