IOCTL的I/O控制疑问
时间:2011-03-01
来源:互联网
_IOR(base, command, size)
/*
* _IOR means that we're creating an ioctl command
* number for passing information from a user process
* to the kernel module.
*
* The first arguments, MAJOR_NUM, is the major device
* number we're using.
*
* The second argument is the number of the command
* (there could be several with different meanings).
*
* The third argument is the type we want to get from
* the process to the kernel.
*/
没看懂第二个参数是什么意思啊?有大牛了解吗?
/*
* _IOR means that we're creating an ioctl command
* number for passing information from a user process
* to the kernel module.
*
* The first arguments, MAJOR_NUM, is the major device
* number we're using.
*
* The second argument is the number of the command
* (there could be several with different meanings).
*
* The third argument is the type we want to get from
* the process to the kernel.
*/
没看懂第二个参数是什么意思啊?有大牛了解吗?
作者: onlyff608 发布时间: 2011-03-01
以_IOR('V', 0, struct v4l2_capability)为例,第一个参数是幻数,第二个就是命令,第三个是传替参数的大小。第二个参数根据不同的命令可以定义为任意数字,这个就看个人喜好了。比如:
#define cmdA _IOR('V',0,struct v4l2_capability)
#define cmdB _IOR('V',1,struct v4l2_capability)
#define cmdC _IOR('V',2,struct v4l2_capability)
#define cmdD _IOR('V',3,struct v4l2_capability)
#define cmdA _IOR('V',0,struct v4l2_capability)
#define cmdB _IOR('V',1,struct v4l2_capability)
#define cmdC _IOR('V',2,struct v4l2_capability)
#define cmdD _IOR('V',3,struct v4l2_capability)
作者: steven_miao 发布时间: 2011-03-02
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28