对read、write函数的loff *ppos参数的疑惑
static ssize_t mem_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos)static ssize_t mem_write(struct file *filp, const char __user *buf, size_t size, loff_t *ppos)
struct file 结构中不是有当前的读写位置的变量吗。为什么函数仍要传递“loff_t *ppos”这个值呢? 传递了这个参数,就更新了file结构体中那个值。。。
页:
[1]