Where is the source code for mmap function? 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?
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