A linux kernel newbie question.
the man pag开发者_开发问答es of mmap state that ".. otherwise, it shall return a value of MAP_FAILED and set errno to indicate the error... "
I have looked through the kernel code for mmap under /usr/src/linux/mm/mmap.c but I could not find a place where mmap returns MAP_FAILED.
Can anyone point me as to where can I find the same.
Thanks
You won't find MAP_FAILED
in the kernel; instead, it's defined in userspace and used by mmap
, the userspace function that wraps the system call. See the glibc source for mmap
.
精彩评论