第一个代码
来源:互联网 发布:诸葛亮网络用语含义 编辑:程序博客网 时间:2024/04/30 11:50
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
static unsigned int hello_major;
static int hello_open (struct inode *inode, struct file *file)
{
return 0;
}
static ssize_t hello_read (struct file *file, char __user *buf, size_t count, loff_t *opps)
{
return 0;
}
static ssize_t hello_write (struct file *file, const char __user *buf, size_t count, loff_t *opps)
{
return 0;
}
struct file_operations hello_fops{
.owner = THIS_MODULE,
.open = hello_open,
.write = hello_write,
.read = hello_read,
};
static int __init hello_init(void)
{
hello_major=register_chrdev(0, "hello", &hello_fops);
return 0;
}
static void __exit hello_exit(void)
{
unregister_chrdev(hello_major, "hello");
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");
- 第一个JAVA代码
- 第一个JAVAMAIL代码
- 第一个D3D代码
- GLSL 第一个代码
- 第一个代码
- 第一个单元测试代码
- VC----第一个代码
- 第一个javascript代码
- 第一个html代码
- 第一个JSTL代码
- 第一个Windows代码
- 第一个python代码
- 单片机第一个代码
- 第一个C代码电子钟
- 第一个 CGIC sqlite3 代码
- 第一个JavaScript代码:JS
- ZeroMQ的第一个代码
- ISO swift代码 第一个
- 动态汉诺塔(c语言)
- 内部类
- ucos-ii移植笔记(ARM7平台)
- CET,GMT等各种时间总结
- 不用加减乘除完成两数相加
- 第一个代码
- VS HelpLibAgent.exe已停止工作 解决方法
- 关于opencv内存泄露的一些记录
- installing-gmt-under-cygwin
- Oracle出现“TNS: 监听程序无法分发客户机连接”解决方法
- 使用pl/sql来Oracle创建表空间和创建用户 .
- linux网络配置文件及其对应功能
- 一个由24个字母组成的数组,其中每个字符出现3次(也就是8组相同字母,混序放在一个数组中),用程序实现将相同字母的下标存入一个8*3的数组中
- 二叉树问题