驱动笔记 - file_operations
#include <linux/fs.h>
struct file_operations {
struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*read) (struct file *, char __user *, size_t, loff_t *);
ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *);
ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t);
int (*readdir) (struct file *, void *, filldir_t);
unsigned int (*poll) (struct file *, struct poll_table_struct *);
int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); //已经被unlocked_ioctl替代
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 *);
int (*flush) (struct file *, fl_owner_t id);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*aio_fsync) (struct kiocb *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
int (*check_flags)(int);
int (*flock) (struct file *, int, struct file_lock *);
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
int (*setlease)(struct file *, long, struct file_lock **);
};
驱动笔记 - file_operations的更多相关文章
- linux 2.6 驱动笔记(一)
本文作为linux 2.6 驱动笔记,记录环境搭建及linux基本内核模块编译加载. 环境搭建: 硬件:OK6410开发板 目标板操作系统:linux 2.6 交叉编译环境:windows 7 + v ...
- 嵌入式Linux驱动笔记(十八)------浅析V4L2框架之ioctl【转】
转自:https://blog.csdn.net/Guet_Kite/article/details/78574781 权声明:本文为 风筝 博主原创文章,未经博主允许不得转载!!!!!!谢谢合作 h ...
- Samsung_tiny4412(驱动笔记03)----字符设备驱动基本操作及调用流程
/*********************************************************************************** * * 字符设备驱动基本操作及 ...
- Samsung_tiny4412(驱动笔记04)----volatile,container_of,file_operations,file,inode
/*********************************************************************************** * * volatile,co ...
- LINUX驱动笔记 目录
笔记参考了宋宝华老师的<Linux设备驱动开发详解:基于最新的Linux 4.0内核>以及韦东山老师的嵌入式驱动教程 笔记开发环境: 单板:第一章到第八章使用TINY4412-1611:第 ...
- linux 2.6 驱动笔记(二)
字符设备驱动 linux 2.6的字符驱动由cdev结构体描述,具体参考globalmem例子,代码主要分以下几部分: 1. 定义一个字符类型设备驱动的结构体 struct globalmem_dev ...
- 入门级的按键驱动——按键驱动笔记之poll机制-异步通知-同步互斥阻塞-定时器防抖
文章对应视频的第12课,第5.6.7.8节. 在这之前还有查询方式的驱动编写,中断方式的驱动编写,这篇文章中暂时没有这些类容.但这篇文章是以这些为基础写的,前面的内容有空补上. 按键驱动——按下按键, ...
- 驱动笔记 - platform中断程序
platform_device: #include <linux/module.h> #include <linux/types.h> #include <linux/f ...
- Samsung_tiny4412(驱动笔记06)----list_head,proc file system,GPIO,ioremap
/**************************************************************************** * * list_head,proc fil ...
随机推荐
- web.config的奇淫巧技
<connectionStrings configSource="db.config"/> 外部文件db.config: <connectionStrings&g ...
- xm 命令详解
xm 命令详解 xm addlabel label dom configfile [policy] xm addlabel label res resource [policy] 增加了名称为labe ...
- 使用supervisor的一些注意事项
一直都有在使用supervisor来管理linux上的服务进程.最近有同事说有某服务貌似有问题,让上去检查一下.上去以后发现某服务反应的确很慢,所以就用supervisor重启一下.但是重启的时候就发 ...
- 浅议iOS网络数据解析
/*------------------------------------ 数据解析: 1.JSON数据 --------------------------------*/ 重点:1.什么是JSO ...
- C 函数可变参数
C 函数可变参数 C 语言中用 ... 表示可变参数,例如: void fun(int x ...) 头文件 cstdarg.h 中包含可变参数类型va_list和处理可变参数的三个宏: va_lis ...
- SharePoint 项目的死法(一)
SharePoint是Microsoft的一个巨NB的产品, 从可查到的数据来看, 财富500强中已经有超过80%的企业已经使用了SharePoint的不同版本,从项目实施的经验来看, 个人感觉这个数 ...
- ThinkPHP目录结构
ThinkPHP框架目录结构 文件路径 文件描述 \index.php 入口文件 \Application 应用目录 \Public 资源文件目录 \ThinkPHP 框架核心目录 \Applic ...
- struts2传递参数值的3中方式
在使用struts2的时候,当要传递的参数不多的时候,我们会选择使用属性来传参,而当要传递的参数很多的时候,或者多个action会有共用的参数时,我们会使用另外两种传参方式. 注意:使用Model D ...
- 记录一下mvc发布
让别人也可以访问你电脑上的ASP.NET MVC创建的网站 http://www.cnblogs.com/laoqi/p/4169184.html
- 找到一个学习bootstrap的好网站
http://www.w3cschool.cc/bootstrap/bootstrap-css-overview.html