I'm new to XNU kernel and partially confused.
I see that we a function in file vm_unix.c
:
kern_return_t task_for_pid(struct task_for_pid_args *args)
with the comment:
// This should be a BSD system call, not a Mach trap!!!
then 2 declarations in osfmk\mach
:
/*
* Obsolete interfaces.
*/
extern kern_return_t task_for_pid(
mach_port_name_t target_tport,
int pid,
mach_port_name_t *t);
extern kern_return_t task_for_pid(
struct task_for_pid_args *args);
and trap decleration in kern
/* 45 */ MACH_TRAP(task_for_pid, 3, 3, munge_www),
So as you can see I found 2 declarations and only 1 implementation.
Where is the implementation of the 3 parameter match trap? How has the transition from 3 parameters to 1 parameter happened?