Accessing processlist to determine, if a process is running / struct kinfo_proc

Chris fbsd at neverland.ch
Thu Oct 20 09:56:57 UTC 2016


Dear list

I decided to revive an old monitoring program I once wrote for NetBSD
and adapted it to FreeBSD's system calls.
One of the probes is supposed to check, if a process is still running.

When compiling, clang barfs:

---------------------------- 8< ----------------------------
clang -c -Wall psprobe-BSD.c
psprobe-BSD.c:65:48: error: subscript of pointer to incomplete type 'struct kinfo_proc'
                snprintf(CommandString, 64, "%s: ", processes[i].p_comm);
                                                    ~~~~~~~~~^
/usr/include/kvm.h:56:8: note: forward declaration of 'struct kinfo_proc'
struct kinfo_proc;
       ^
---------------------------- 8< ----------------------------

What I don't understand is: why isn't struct kinfo_proc completely 
defined there? I couldn't find it's definition below /usr/include 
anywhere.

Can anybody give me a hint?

I'll gladly send the complete file to the list if that's appropriate.

Thanks
Chris

-- 
------------------------------------------------------------------------
Chris                                                  fbsd at neverland.ch
------------------------------------------------------------------------


More information about the freebsd-questions mailing list