I'm not aware of a public direct proc_t
->task_t
lookup KPI, unfortunately.
However, in some cases, you might be able to get away with using current_task()
and holding on to that pointer for as long as you need it. Use task_reference
and task_deallocate
for reference counting (but don't hold references forever obviously, otherwise they'll never be freed). You can also access the kernel's task (corresponding to process 0) anytime via the global variable kernel_task
.