file_operations结构体中几个重要函数的原型

file_operations结构体中几个重要函数的原型

① int (*open) (struct inode *, struct file *);

② int (*release) (struct inode *, struct file *);

③ ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);

④ ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);//有const,勿忘!

⑤ int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);

⑥ unsigned int (*poll) (struct file *, struct poll_table_struct *);

⑦ loff_t (*llseek) (struct file *, loff_t, int);

你可能感兴趣的:(file_operations结构体中几个重要函数的原型)