• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get parent process (Carbon question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Get parent process (Carbon question) (From: Renaud Boisjoly <email@hidden>)

  • Prev by Date: show passphrase
  • Next by Date: Re: Get parent process (Carbon question)
  • Previous by thread: Re: Get parent process (Carbon question)
  • Next by thread: Re: Get parent process (Carbon question)
  • Index(es):
    • Date
    • Thread