I am experimenting with the Mac OS X 10.6.5 kernel libraries. Specifically, I am attempting to do a very simple call to the crget() function (please see: http://fxr.watson.org/fxr/source/sys/ucred.h?v=DFBSD#L101 for function prototype).
The code is only:
#include <sys/param.h>
#include <sys/ucred.h>
// Main().
int main (void) {
// Return a ucred struct from kernel for this process.
struct ucred *processCredentials = crget();
// Rest of code...
return 0;
}
XCode reports:
Undefined symbols for architecture i386:
“_crget”, referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
Can someone please tell me what I’m missing ?
Thanks,
Scott
From the documentation:
So unless you’re modifying the kernel proper, or using what may amount to an atrocious hack, you can’t link against them.