struct dev_t
device number(dev_t)
linux driver 2009-08-21 10:08:03 阅读26 评论0 字号:大中小
dev_t
description:
the dev_t type in is used to hold device numbers—both the major and minor
parts.
header:
#include
constructor:
MKDEV(int major, int minor);
method:
MAJOR(dev_t dev); //obtain the major part of a dev_t
MINOR(dev_t dev); //obtain the minor part of a dev_t
register_chrdev_region(); //manually obtain(register) device numbers
from the system
alloc_chrdev_region(); //allocate a major number by kernel
unregister_chrdev_region(); //free the device number back to kernel
int print_dev_t(char *buffer, dev_t dev); //encode the device number into the given buffer;
char *format_dev_t(char *buffer, dev_t dev); //encode the device number into the given buffer;
转载自:http://leewez.blog.163.com/blog/static/2958954620097211083517/
struct dev_t的更多相关文章
- Learn ZYNQ Programming(1)
GPIO LED AND KEY: part1:gpio leds and gpio btns combination. (include 1~4) part2:use gpio btns inter ...
- Linux Communication Mechanism Summarize
目录 . Linux通信机制分类简介 . 控制机制 0x1: 竞态条件 0x2: 临界区 . Inter-Process Communication (IPC) mechanisms: 进程间通信机制 ...
- linux 字符驱动
1 结构体说明: struct cdev { struct kobject kobj; // 每一个 cdev 都是一个 kobject st ...
- struct stat结构体的详解和用法
[cpp] view plaincopy //! 需要包含de头文件 #include <sys/types.h> #include <sys/stat.h> S_ISLNK( ...
- struct inode 和 struct file
1.struct inode──字符设备驱动相关的重要结构介绍 内核中用inode结构表示具体的文件,而用file结构表示打开的文件描述符.Linux2.6.27内核中,inode结构体具体定义如下: ...
- S_ISREG等几个常见的宏 struct stat
S_ISLNK(st_mode):是否是一个连接.S_ISREG(st_mode):是否是一个常规文件.S_ISDIR(st_mode):是否是一个目录S_ISCHR(st_mode):是否是一个字符 ...
- struct stat 作用
stat,lstat,fstat1 函数都是获取文件(普通文件,目录,管道,socket,字符,块()的属性.函数原型#include <sys/stat.h> int stat(cons ...
- VFS四大对象之二 struct inode
继上一篇文章:http://www.cnblogs.com/linhaostudy/p/7427027.html 二.inode结构体:(转自http://blog.csdn.net/shanshan ...
- VFS四大对象之一 struct super_block
linux虚拟文件系统四大对象: 1)超级块(super block) 2)索引节点(inode) 3)目录项(dentry) 4)文件对象(file) 现在先介绍第一个 一.super_block的 ...
随机推荐
- TCP协议三次握手、四次断开 过程分析
建立TCP连接的过程需要进行三次信息交换,通常称为“三次握手”,示意图如下:
- OpenWrt刷机后LAN口无法连通的问题
[路由器开发板硬件固件配置] MTK双频:MT7620a + MT7612e 内存:256 MB 闪存:16 MB 固件:MTK自带SDK中的OpenWrt固件(mtksdk-openwrt-2.6. ...
- asp.net中的mysql传参数MySqlParameter
注意在asp.net中传参 string sql="select name,id from user where id=@id"; //@idm不需要引号 MySqlParamet ...
- 2435: [Noi2011]道路修建 - BZOJ
Description 在 W 星球上有 n 个国家.为了各自国家的经济发展,他们决定在各个国家之间建设双向道路使得国家之间连通.但是每个国家的国王都很吝啬,他们只愿意修建恰好 n – 1条双向道路. ...
- DatagramChannel
DatagramChannel 最后一个socket通道是DatagramChannel.正如SocketChannel对应Socket,ServerSocketChannel对应ServerSock ...
- shell date
.查看指定时间的时间戳 查看当前时间 #date +%s 查看指定时间 #date -d -- +%s #date -d +%s .将时间戳转换成date #date -d '1970-01-01 U ...
- dede首页调用栏目内容{dedefield.content}的方法
Dedecms的功能确实很强大,但是dedecms的全局变量有字节限制,使得我们在使用dedecms制作企业站的时候,首页无法调用大段大段的企业站. 其实dedecms还有另外一种调用大段内容的方法, ...
- nenu contest3 The 5th Zhejiang Provincial Collegiate Programming Contest
ZOJ Problem Set - 2965 Accurately Say "CocaCola"! http://acm.zju.edu.cn/onlinejudge/showP ...
- .Net 使用 Oracle 提供组件访问数据库
向导式安装客户端组件 32位下载: http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html 批处理式安装客户端组件 ...
- NGUI屏幕自适应解决方案
NGUI研究院之自适应屏幕 http://www.xuanyusong.com/archives/2536 Unity3D研究院之使用Android的硬件缩放技术优化执行效率 http://www.x ...