Re: Equivalent to "ps aux" in Cocoa?
Re: Equivalent to "ps aux" in Cocoa?
- Subject: Re: Equivalent to "ps aux" in Cocoa?
- From: Andrew <email@hidden>
- Date: Thu, 2 Jan 2003 19:54:53 +1100 (EST)
On Thu, 2 Jan 2003, Cameron Hayne wrote:
>
On 31/12/02 12:59 pm, "Arthur VIGAN" <email@hidden> wrote:
>
> I would like to known if there is something to get the pid of a process
>
> in Cocoa, ie an equivalent to "ps aux | grep myProcessName | awk
>
> '{print $2}'"?
>
>
Use the UNIX system call 'getpid()'.
>
% man 2 getpid
That will only tell you the PId of your process. You will probably have to
use kvm_getprocs and kvm_getargv.
Andrew
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.