#include
#include
#include
struct file_operations;
struct inode;
struct module;
struct cdev {
struct kobject kobj;
struct module *owner;
const struct file_opera...
分类:
系统相关 时间:
2014-07-29 14:18:28
阅读次数:
280
在python2.5+中可以用with来保证关闭打开的文件with open('hello.txt') as f: do some file operations为什么要引入with呢?在之前如果要保证关闭文件需要这样:f = open('hello.txt')try: do some fi...
分类:
编程语言 时间:
2014-07-28 11:36:00
阅读次数:
305
1 在Linux驱动中把无法归类的五花八门的设备定义为混杂设备(用miscdevice结构体表述)。miscdevice共享一个主设备号MISC_MAJOR(即10),但次设备号不同。 所有的miscdevice设备形成了一个链表,对设备访问时内核根据次设备号查找对应的miscdevice设备,然后调用其file_operations结构中注册的文件操作接口进行操作。 在内核中用struct m...
分类:
系统相关 时间:
2014-07-22 00:17:34
阅读次数:
415