开发者

Where is MAP_FAILED returned

开发者 https://www.devze.com 2023-02-28 02:52 出处:网络
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... \"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号