• 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: Getting the current PID inside kext?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the current PID inside kext?


  • Subject: Re: Getting the current PID inside kext?
  • From: Andrew Gallatin <email@hidden>
  • Date: Tue, 31 Oct 2006 06:05:23 -0500 (EST)

Rick Mann writes:
 > getpid() doesn't seem to be available to a kext (I try to include
 > <unistd.h> but it fails).
 >
 > Can I use <sys/proc.h> and extern_proc with current_proc() to get at
 > the pid?

Close.  Use proc_selfpid() from sys/proc.h, there is no need to look
at the proc struct.  The proc_* KPI accessors access the proc
structure for you, so that the kernel developers are free to change
its layout without breaking kernel extensions.

Drew
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Getting the current PID inside kext? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Any way to get PID of kauth FILEOP auth requestor?
  • Next by Date: Re: Process name from PID inside kernel?
  • Previous by thread: Re: Getting the current PID inside kext?
  • Next by thread: pci-probe-mask
  • Index(es):
    • Date
    • Thread