In kern/task.h, i found the declare:
__BEGIN_DECLS
extern task_t current_task(void);
extern void task_reference(task_t task);
__END_DECLS
But when i call the function current_task() in an iOS application.
I got the linker error like:
Undefined symbols for architecture i386 from:
"_current_task", referenced from:.... in xxx.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
How to fix this problem?
A simple solution:
Use mach_task_self() to replace the function current_task. Still could returns a pointer to the task structure associated with the currently running kernel thread.
But i still want solve the problem above.:(