Including kern clock.h from a non-kext application
Including kern clock.h from a non-kext application
- Subject: Including kern clock.h from a non-kext application
- From: André Berg <email@hidden>
- Date: Thu, 09 Oct 2008 22:32:14 +0200
Hi,
So what's the secret to be able to include
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/kern/clock.h
?
Specifically I am trying to do the following from a standard tool project's
main.c:
-----------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/sysctl.h>
#include <mach/mach_time.h>
#include <mach/mach_types.h>
#include <CoreServices/CoreServices.h>
// #include <kern/clock.h> <-- If I include it like this, it gives (1
// #include <Kernel/kern/clock.h> <-- gives (2
int main (int argc, const char * argv[]) {
struct mach_timebase_info timebase;
clock_timebase_info(&timebase);
uint64_t nanoseconds = 0ULL;
absolutetime_to_nanoseconds(mach_absolute_time(), &nanoseconds);
return EXIT_SUCCESS;
}
-----------------------------------------
Error Messages:
1) /Users/andre/Documents/Xcode/Command Line
Utility/StandardTool/mach_abstime/main.c:10:24: error: kern/clock.h: No such
file or directory
2) In file included from /Users/andre/Documents/Xcode/Command Line
Utility/StandardTool/mach_abstime/main.c:10:
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Kernel.framework/Headers/kern/clock.h:43:29:
error: kern/kern_types.h: No such file or directory
Tried:
- Dozens of combos for the usual suspects when linking, like "Other
LDFlags", -I, -L ...
- Making an empty General Kernel Extension project and comparing the build
settings one-on-one with the build settings of mach_abstime for both Target
and Project Build Settings.
Or is the saddening truth that one cannot call kern/clock.h interface
functions from a userland app?
Thanks for reading!
André
_______________________________________________
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