-
open:打开一个文件 int (*open) (struct inode *, struct file *);
-
release:释放一个打开的文件 int (*release) (struct inode *, struct file *);
-
read:从文件中读取数据 ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
-
write:向文件中写入数据 ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
-
llseek:修改文件当前读写位置 loff_t (*llseek) (struct file *, loff_t, int);
-
mmap:内存映射文件 int (*mmap) (struct file *, struct vm_area_struct *);
-
flush:将缓冲区中的数据写入磁盘 int (*flush) (struct file *);
-
ioctl:设备控制操作 long (*ioctl) (struct file *, unsigned int, unsigned long);
-
unlocked_ioctl:无锁设备控制操作 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
-
compat_ioctl:32位应用程序设备控制操作 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
-
poll:等待文件描述符的读写事件 unsigned int (*poll) (struct file *, struct poll_table_struct *);
-
fasync:异步通知函数 int (*fasync) (int, struct file *, int);
知识拓展 file_operations结构体中常用函数的解析
最新推荐文章于 2024-07-14 18:35:17 发布