作者rz600000 (冏冏人)
看板LinuxDev
标题Re: [问题] 问一个传递参数的问题..
时间Sat Jun 7 22:20:28 2008
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
1F:→ rz600000:还有 例如 inode 的也是 inode 好像是kernel 帮忙传入? 06/07 22:22