Find the __proc_info character in an XNU project

I would like to find out how the VMMAP process works.

After running this executable with dtrace, it seems that the proc_regionfilename method retrieves the address space of each section in virtual memory.

So, I dug a little deeper and found its implementation in xnu under the file
libsyscall / wrappers / libproc / libproc.c

In the body of the function, I see that the main call is proc_pidinfo:

retval = proc_pidinfo(pid, PROC_PIDREGIONPATHINFO, (uint64_t)address, &reginfo, sizeof(struct proc_regionwithpathinfo)); 

And proc_pidinfo, which in turn calls the __proc_info character:

 int __proc_info(int callnum, int pid, int flavor, uint64_t arg, void * buffer, int buffersize); 

However, this symbol cannot be found in the code, and I wonder how it is created during pre-compilation, compilation, link, or real-time.

Any idea where I can find it or how it is created (I have not tried to compile the kernel yet).

thanks

+7
c xnu macos mach vmmap
source share
1 answer

proc_info is syscall, so its implementation is in the kernel. The source code for the version found in 10.11.2 can be found here:

http://opensource.apple.com/source/xnu/xnu-3248.20.55/bsd/kern/proc_info.c

+1
source share

All Articles