Accessing processlist to determine, if a process is running / struct kinfo_proc
Polytropon
freebsd at edvax.de
Thu Oct 20 10:15:43 UTC 2016
On Thu, 20 Oct 2016 11:56:54 +0200, Chris wrote:
> 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.
It's in the sys/ subdirectory.
> Can anybody give me a hint?
You need to #include <sys/user.h> where you will find the complete
defintion of struct kinfo_proc.
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions
mailing list