建议直接从inode 获取设备号
来源:互联网 发布:android 移动网络状态 编辑:程序博客网 时间:2024/06/16 07:01
The inode Structure
The inode structure is used by the kernel internally to represent files. Therefore, it isdifferent from the file structure that represents an open file descriptor. There can be
numerous file structures representing multiple open descriptors on a single file, but
they all point to a single inode structure.
rule, only two fields of this structure are of interest for writing driver code:
For inodes that represent device files, this field contains the actual device number.
struct cdev is the kernel’s internal structure that represents char devices; this
field contains a pointer to that structure when the inode refers to a char device
file.
lot of drivers. As a way of encouraging more portable programming, the kernel developers have added two macros that can be used to obtain the major and minor number from an inode:
i_rdev的类型在2.5版本中发生了改变,很多驱动因此不能运行,为了代码的移植性,内核开发者特意加了两个宏iminor,imajor,让我们直接从inode中就可以获得到主次设备号:
unsigned int imajor(struct inode *inode);
instead of manipulating i_rdev directly.
为了避免以后的变更带来的影响,我们最好使用上述的宏来获取主次号,而不是直接对inode结构中的i_rdev进行操作。ldd3.P55
0 0
- 建议直接从inode 获取设备号
- inode获取设备号
- inode 设备文件
- 从设备环境获取位图
- 从TelephonyManager获取设备信息
- 从名称获取设备对象
- 直接从RING3获取硬盘序列号
- 直接从RING3获取硬盘序列号
- 直接从RING3获取硬盘序列号
- r 直接从网上获取数据
- XProxy点滴:Winpcap获取设备列表时的建议
- android反馈与建议时获取设备号包名那些东西
- Android 设备从 Server获取文本
- Android 从输入设备获取消息
- 序列号和设备标识UDID码手机直接获取方式
- 序列号和设备标识UDID码手机直接获取方式:
- ios快速获取设备的UDID手机直接查看
- 从 inode 了解 Linux 文件系统
- spring boot--用于简便快捷的搭建基于spring的独立可运行的应用(未测试)
- java图片灰度化原理与实现(未测试)
- js利用数组实现队列与堆栈效果
- Spring 定时器
- Ubuntu下安装Android studio!!
- 建议直接从inode 获取设备号
- What is the difference between iface eth0 inet manual and iface eth0 inet static?
- Spark Transformation —— randomSplit
- 复制构造函数的浅拷贝和深拷贝
- Java开发之文件上传 (未测试)
- 物理学的理解
- 个人项目上传GitHub
- 【深度学习】简单地利用keras做车标识别
- linux驱动中的,时间, 延时