So I was searching for sys/mman.h and ideally sys/mman.c in https://opensource.apple.com/source/Libc/Libc-1244.20.1/ and didn't find it. Any idea why? Where could I find the source?
1 Answer
I assume you mean mmap.c - you can find the source files here:
https://github.com/apple/darwin-xnu/blob/5394bb038891708cd4ba748da79b90a33b19f82e/libsyscall/wrappers/unix03/mmap.c https://github.com/apple/darwin-xnu/blob/master/bsd/sys/mman.h
The kernel part of the implementation where the functionality actually lies can be found here:
-
Thank you! Apologies for being a bit incessant, but where do I go next? github.com/apple/darwin-xnu/blob/… the __mmap function doesn't seem to have any definition in the file (only declaration) - only a passing occurence in syscalls.map, when I searched the whole xnu sources for __mmap. I'd like to dig into the real wrapperless impl (ideally down to kernel space, I seem to be stuck ;) ) Feb 11, 2018 at 11:11
-
1I have added a link to the implementation of the mmap functionality in the kernel. Feb 11, 2018 at 18:36