On 5/30/26 21:36, Warner Losh wrote:
    +    for (int i = 0; i < n; ++i) {
    +        struct kinfo_vmentry *k = &entries[i];
    +        size_t path_len = strnlen(k->kve_path, sizeof(k->kve_path)) + 1;


This is shorter than what I had in blitz.

Shorter, but wrong, since it's never 0.


    +        MapInfo *e = g_malloc0(sizeof(*e) + path_len);


My version did the following only if
       if (kve->kve_type != KVME_TYPE_GUARD &&
             kve->kve_type != KVME_TYPE_DEAD) {

though now I see my version would have been better with the
contrapositive and continue.

You wouldn't want to skip GUARD, since for the purpose of probe_guest_base GUARD is reserved memory. What does DEAD mean? Is that the multithreaded thing?

    +    free(entries);


I had g_free() here, but I am a 'cargo cult' glib user...

I know they're the same these days, but I minded the man page which says 'free'.

    +
    +if host_os == 'freebsd'
    +  libutil = cc.find_library('util', required: true)
    +  user_ss.add(libutil)
    +endif


This dependency is likely fine, but as I said in my other mail using the sysctl obviates the need for this.

I'm fine either way.  Perhaps this isn't worth pulling in the external 
dependency.

And thank you so much for writing this, even though there's a small collision here. I do very much appreciate it.

You're welcome.


r~

Reply via email to