9 Jul
2024
9 Jul
'24
4:43 p.m.
The handles returned by libproc (namely struct socket_info's soi_pcb) use all 64 bits, but the ones from the pcblist sysctl are truncated to 32. That makes find_owning_pid fail. The pcblist64 sysctl was added in macOS 10.6 and returns handles that match those from libproc. -- There does not seem to be a MIB constant for pcblist64, so I had to fetch it with sysctlbyname. -- v2: nsiproxy.sys: Use net.inet.tcp.pcblist64 to enumerate connections on macOS. https://gitlab.winehq.org/wine/wine/-/merge_requests/6021