Re: Get parent process (Carbon question)
Re: Get parent process (Carbon question)
- Subject: Re: Get parent process (Carbon question)
- From: Aram Greenman <email@hidden>
- Date: Fri, 6 Sep 2002 21:33:31 -0700
On Friday, September 6, 2002, at 02:16 PM, Renaud Boisjoly wrote:
I was looking for a way to get the process id and then figure out the
name of the process...
I have an Obj-C class, PSProcess, that does this, for example:
PSProcess *me, *mom;
NSString *name;
int pid;
me = [PSProcess currentProcess];
mom = [me parent];
name = [me command];
pid = [me processIdentifier];
Source is available at
http://students.washington.edu/grnmn/
I thought I coul duse part of the Carbon stuff once I had the pid, but
Carbon relies on a ProcessSerialNumber, which is different from the
pid...
You can get a ProcessSerialNumber from a pid with
extern OSStatus
GetProcessForPID(
pid_t pid,
ProcessSerialNumber * psn);
_______________________________________________
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.