0

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
  • 2
    I'm voting to close this question as off-topic because of two reasons - why Apple does/doesn't do something and finding off site resources are both off topic here.
    – Allan
    Feb 10, 2018 at 11:30

1 Answer 1

2

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:

https://github.com/apple/darwin-xnu/blob/5394bb038891708cd4ba748da79b90a33b19f82e/bsd/kern/kern_mman.c

2
  • 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
  • 1
    I have added a link to the implementation of the mmap functionality in the kernel.
    – jksoegaard
    Feb 11, 2018 at 18:36

Not the answer you're looking for? Browse other questions tagged .