[ARTICLE] First steps in programming FreeBSD: Reading process information

I occasionally come across people on the FreeBSD forum and discord asking, "How do I get started developing on FreeBSD?" I have wondered the same thing. In this post, I'll share my experience dipping my toes in the water of FreeBSD development for the first time.

My programming objective for this post is to read process information - effectively, a stripped-down version of ps(1). I will show you how I found the FreeBSD-specific information needed to do that.

read the article
 
There's also the sysctl approach that you can see in lib/libutil/kinfo_getallproc.c

I made a FreeBSD/NetBSD version of a Linux program that shows if there are processes that could be restarted (meaning that the binaries or libraries were deleted or updated).

 
Back
Top