Date: Thu, 20 Oct 2016 12:28:32 +0200 From: Chris <fbsd@neverland.ch> To: Polytropon <freebsd@edvax.de> Cc: freebsd-questions@freebsd.org Subject: Re: Accessing processlist to determine, if a process is running / struct kinfo_proc Message-ID: <20161020102832.GA5160@viper.neverland.ch> In-Reply-To: <20161020121540.8dcbaa49.freebsd@edvax.de> References: <20161020095654.GA4979@viper.neverland.ch> <20161020121540.8dcbaa49.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Polytropon (freebsd@edvax.de): > 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. > Aah, I must have been blind all the time! Thanks a lot for your help :-) Kind regards and have a nice day Chris
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161020102832.GA5160>