task_for_pid reference
task_for_pid reference
- Subject: task_for_pid reference
- From: Rodrigo Vanegas <email@hidden>
- Date: Sat, 26 Mar 2011 17:34:28 -0700
I'm reading through source code to learn a bit about OS X kernel programming, and I've come across this bit of code
pid_t pid;
kern_return_t res;
task_t task;
...
res = task_for_pid(mach_task_self(), pid, &task)
Where are task_for_pid and mach_task_self defined or documented? I've googled around for the former and found only indirect references including these
http://developer.apple.com/library/mac/search/index.php?Search=task_for_pid and a few passing mentions of it in the archives of this mailing list. The latter seems to be part of the core syscalls for Mach, but even this I saw documented only briefly here:
http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_task_self.html and mentioned here:
http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/. I vaguely understand mach tasks and ports, so I have a working understanding of what this call is doing and how, and I also have figured out by now that task_for_pid is providing the process to task mapping after a security check involving taskgated. But this system service, again, seems to be nowhere documented, except briefly in a section 8 man page which makes reference to task_for_pid, but doesn't reveal very much more.
Is it time to look through texts on OS X internals? Or am I missing something here? Any pointers would be appreciated!
--
Rodrigo Vanegas
email@hidden
_______________________________________________
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