I'm still waiting for this to compile, so I promise nothingprocstat fails because we don't kvm_read every entry as part of the search for the successor. Define a vm_map method to allow advance from an entry to its successor using a reader method and a token passed in along with the entry. Use that method in procstat.
Note that procstat_getfiles_kvm goes into an infinite loop if kvm_read_all fails to read a map entry, so I'm trying to address that at the same time.
I'll update after testingcurrently, procstat_getfiles_kvm goes into an infinite loop if kvm_read_all fails to read a map entry, which is hours away.so I'm trying to address that at the same time.