• 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: Rick Mann <email@hidden>
  • Date: Mon, 30 Oct 2006 21:19:18 -0800


On Oct 30, 2006, at 21:13 , Justin C. Walker wrote:

getpid() doesn't seem to be available to a kext (I try to include <unistd.h> but it fails).

If you are trying to use this header in a kernel extension, you may not fully understand the programming model. Nothing in /usr/ include is usable in the kernel or its extensions. Nothing in /usr/ lib is usable in the kernel. Some functions and definitions that occur in /usr/include may be provided by the kernel, but they aren't really the same.

Okay, that's fine, I remember reading that.

Can I use <sys/proc.h> and extern_proc with current_proc() to get at the pid?

You should review the KPI documents to see how to interact with the kernel. Check the Apple developer website:


<http://developer.apple.com/documentation/Darwin/Conceptual/ KEXTConcept/KEXTConceptDependencies/kext_dependencies.html>

This document seems to indicate that sys is available, but when I include <sys/proc.h>, struct extern_proc does not get declared. I can't seem to figure out why not, except perhaps the compiler is including a different file than Command-D is opening up for me.



-- Rick


_______________________________________________ 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
  • Follow-Ups:
    • Re: Getting the current PID inside kext?
      • From: Quinn <email@hidden>
    • Re: Getting the current PID inside kext?
      • From: "Justin C. Walker" <email@hidden>
References: 
 >Getting the current PID inside kext? (From: Rick Mann <email@hidden>)
 >Re: Getting the current PID inside kext? (From: "Justin C. Walker" <email@hidden>)

  • Prev by Date: Re: Getting the current PID inside kext?
  • Next by Date: Re: Getting the current PID inside kext?
  • Previous by thread: Re: Getting the current PID inside kext?
  • Next by thread: Re: Getting the current PID inside kext?
  • Index(es):
    • Date
    • Thread