Skip to content

Commit

Permalink
Use unix.SysctlRaw for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokeqx authored and nekohasekai committed Jul 22, 2024
1 parent 1349acf commit e5991ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/process/searcher_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ func findProcessName(network string, ip netip.Addr, port int) (string, error) {

isIPv4 := ip.Is4()

value, err := syscall.Sysctl(spath)
value, err := unix.SysctlRaw(spath)
if err != nil {
return "", err
}

buf := []byte(value)
buf := value

// from darwin-xnu/bsd/netinet/in_pcblist.c:get_pcblist_n
// size/offset are round up (aligned) to 8 bytes in darwin
Expand Down

0 comments on commit e5991ca

Please sign in to comment.