如果没有实现compat_ioctl,那么32位的用户程序在64位的kernel上执行ioctl时会返回错误:Not a typewriter。 2)如果是64位的用户程序运行在64位的kernel上,调用的是unlocked_ioctl,如果是32位的用户程序运行在32位的kernel上,调用的也是unlocked_ioctl。 3. struct file_operations结构体 structfile_operations{structmod...
如果一个驱动的 poll 方法为 NULL,设备假定为不阻塞地可读可写。 10、long (*unlocked_ioctl) kernel-2.6 以前,使用的是 ioctl;kernel-2.6 以后,使用 unlocked_ioctl。 11、long (*compat_ioctl) 兼容性的 ioctl,为了让 32-bit 的 process 可以在 64-bit 上的 system 来执行 ioctl() 12、int (*mmap) ...
int, loff_t, u64, unsigned); struct dir_context { filldir_t actor; loff_t pos; }; struct block_device_operations; /* These macros are for out of kernel modules to test that * the kernel supports the unlocked_ioctl and compat_ioctl * fields in struct file_operations. *...
unsigned int (*poll) (struct file *, struct poll_table_struct *); long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct...
1. struct file_operations{ ... }结构体 1/*2* NOTE:3* read, write, poll, fsync, readv, writev, unlocked_ioctl and compat_ioctl4* can be called without the big kernel lock held in all filesystems.5*/6structfile_operations {7struct module *owner;8loff_t (*llseek) (structfile *,...
long (*compat_ioctl) (); int (*mmap) (); int (*open) (); int (*flush) (); int (*release) (); int (*fsync) (); int (*aio_fsync) (); int (*fasync) (); int (*lock) (); ssize_t (*sendfile) (); ssize_t (*sendpage) (); ...
11、long (*compat_ioctl) 兼容性的 ioctl,为了让 32-bit 的 process 可以在 64-bit 上的 system 来执行 ioctl() 12、int (*mmap) 用来请求将设备内存映射到进程的地址空间。一般涉及到图像方面,会使用此函数,比如 framebuffer。如果这个方法是 NULL,mmap 系统调用返回 -ENODEV。
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); ...
long (*compat_ioctl) (struct file *, unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); unsigned long mmap_supported_flags; int (*open) (struct inode *, struct file *); int (*flush) (struct file *, fl_owner_t id); ...
(*unlocked_ioctl)(structfile*,unsignedint,unsignedlong);long(*compat_ioctl)(structfile*,unsignedint,unsignedlong);int(*mmap)(structfile*,structvm_area_struct*);unsignedlongmmap_supported_flags;int(*open)(structinode*,structfile*);int(*flush)(structfile*,fl_owner_t id);int(*release)(struct...