Is it possible to use kstat to get information about which processes have which ports open? I've looked into how lsof does it and apparently they read volatile kernel memory, which kstat seems to give access to (please correct me if I'm wrong).
I was just wondering if anyone knows how to filter kstat to display information about which processes a port has open. Perhaps which module should I look at?
No,
kstat
doesn't store process level information. Moreover,kstat
doesn't give access to volatile kernel memory but only to specific kernel statistics.Finally, you shouldn't have started a new question instead of following up here.