→ rz600000:還有 例如 inode 的也是 inode 好像是kernel 幫忙傳入? 06/07 22:22
1055 struct file_operations {
......
1067 int (*mmap) (struct file *, struct vm_area_struct *);
.....
1085 };
以上 kernel source code 中file_operation 的 mmap proto type
而從user space 呼叫的 proto type
void *mmap (void *__addr, size_t __len, int __prot,
int __flags, int __fd, __off_t __offset) __THROW;
兩者是不一樣的...
※ 引述《rz600000 (冏冏人)》之銘言:
: 我記得很久前有在某個地方看過
: 但是一直找不到我在哪裡看過
: 就是 今天假如一個mmap function
: static int xxx_mmap (struct file *file, struct vm_area_struct *vma)
: 裡面的file 跟 vma 參數是怎麼樣產生的
: 我知道跟user space 所傳遞的參數是不一樣的
: 但是那兩個參數是怎麼出現的
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 125.230.64.84