[OS X Emacs] Re: M-x proced

Leo sdl.web at gmail.com
Tue Mar 9 16:55:48 EST 2010

On 2010-03-08 21:29 +0000, David Reitter wrote:
> On Mar 8, 2010, at 3:59 PM, Leo wrote:
>> I have implemented list-system-processes without too much knowledge of C
>> but the more difficult part is system_process_attributes.
> I guess this is a bit more involved - but it shouldn't be difficult in general.
> We don't have /proc, so we need to use some APIs. 
> See here:
> http://stackoverflow.com/questions/220323/determine-process-info-programmatically-in-darwin-osx
> http://developer.apple.com/mac/library/documentation/Carbon/Reference/Process_Manager/Reference/reference.html
> GetProcessInformation() would be pretty informative.
> I think that's going to be less messy than parsing some /proc output.
> Hope that helps.

Thanks, David.

I have reimplmented list_system_processes using sysctl.h. I am halfway
through system_process_attributes, see this screenshot:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: proced-osx.png
Type: image/png
Size: 188254 bytes
Desc: proced-osx.png
URL: <http://email.esm.psu.edu/pipermail/macosx-emacs/attachments/20100309/31f11e8d/attachment.png>
-------------- next part --------------

However, do you know how to get the cpu and mem percentage?

struct extern_proc.p_pctcpu always gives me '0'.


More information about the MacOSX-Emacs mailing list