Foray into OS X

djberg96 on 2003-05-09T04:22:23

I couldn't log into SourceForge's compile farm for some reason, so Michael Granger was kind enough to provide me with an account on his OS X box. I decided to see if I could port some code. Specifically, I wanted to start working on a port of Sys::ProcTable (which is a port of Proc::ProcessTable).

At first things looked like they might be exceptionally easy. There's a proc.h file in /usr/include/sys that has a "struct proc" defined which I figured would make life pretty simple.

There's only one problem - it's broken. Go ahead - try and #include it. See what happens. I searched around on Google some, but I couldn't find anything OS X specific.

UPDATE: After doing some research, Michael found out that you have get a kvm_open and kvm_getprocs, or use sysctl(3). Seems like a cross between FreeBSD and Solaris.