Search code examples
macosmach

What is the difference between the mach headers in /usr/include and the ones in the SDK?


In MacOS X there are Mach kernel headers located both at

  • /usr/include/mach and
  • /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach

These headers do not match: they provide different APIs (functions, types, etc).

  • What is the difference between them?
  • When should I use which?

Solution

  • From Apple's documentation for the Kernel framework:

    The Kernel Framework provides the APIs and support for kernel-resident device drivers and other kernel extensions.

    If that's not what you're programming, then you shouldn't use it (including header files from it).