上一页 1 2 3 4 5 6 7 8 ··· 21 下一页
摘要: 本例一共三种类型模块参数——无符号整型,字符串,字符串数组#include #include #include #include #define ACCESS (0644)static uint age = 24; module_param(age, uint, ACCESS);static ch... 阅读全文
posted @ 2015-05-30 18:36 net小伙 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 4 static int __init hello_init(void){ 5 printk("hello kernel!\n"); 6 return 0; 7 } 8 9 static void __exit hello_e... 阅读全文
posted @ 2015-05-24 17:14 net小伙 阅读(314) 评论(0) 推荐(0) 编辑
摘要: cannot change directory:/home/***ftp服务器连接失败,错误提示:500 OOPS: cannot change directory:/home/*******500 OOPS: child died解决方法:在终端输入命令:setsebool -P ftpd_dis... 阅读全文
posted @ 2015-03-31 22:41 net小伙 阅读(1604) 评论(0) 推荐(0) 编辑
摘要: 这个错误网上搜索发现3.0.0.15版本内核 file_operation结构体已经删除了ioctl函数,取代的是:long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);long (*compat_ioctl) (st... 阅读全文
posted @ 2015-01-11 14:05 net小伙 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 如何生成动态库 net小伙 已经在此文中说明——【C】——如何生成静态库和动态库;接下来就要看看动态库中函数的作用范围; 首先我们使用命令 gcc -fPIC -shared -o libtest.so test.c 生成一个动态库 —— libtest.so。 test.c 代码如下(一个很... 阅读全文
posted @ 2014-12-11 21:41 net小伙 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 对于一个编译型语言,编译器工作时总要经过预处理、编译、链接等几个过程。以 C/C++ 为例:预处理器(cpp)将每个 .c/.cpp 文件中 #include 的头文件都合并到 .c/.cpp 文件中,并且对其进行宏扩展,由此生成数个编译单元。一般来说每个 .c/.cpp 文件对应一个编译单... 阅读全文
posted @ 2014-12-11 21:17 net小伙 阅读(790) 评论(0) 推荐(0) 编辑
摘要: c语言字符串函数详解void *memset(void *dest, int c, size_t count);将dest前面count个字符置为字符c.返回dest的值.void *memmove(void *dest, const void *src, size_t count);从src复制c... 阅读全文
posted @ 2014-05-22 10:18 net小伙 阅读(10815) 评论(1) 推荐(1) 编辑
摘要: 一、arm-9 TQ2440 key.h 1 #ifndef __KEY_H__ 2 #define __KEY_H__ 3 4 #define GPFCON (*(volatile unsigned long *)0x56000050) 5 #define GPFDAT (*(volatile unsigned long *)0x56000054) 6 7 extern void key_init(void); 8 extern int key1(void); 9 extern int key2(void);10 extern int key3(void);11 extern int k.. 阅读全文
posted @ 2014-03-30 17:37 net小伙 阅读(2264) 评论(0) 推荐(0) 编辑
摘要: 案例: 功能:可以根据用户输入的命令完成相应的功能; 例如: 用户输入 hello 完成输出 hello的功能。 用户输入 hi 完成输出 hi 的功能。一般的写法可能会写两个函数来实现 输出 hello 和 hi 的功能,然后在根据用户输入的字符串与 hello 和 hi 比较,然后执行相应的函数。代码如下: 1 //回调函数的用处 2 #include 3 #include 4 5 void hello(void); 6 int my_strcmp(char* des, char* src); 7 void hi(void); 8 9 int main(void){... 阅读全文
posted @ 2014-03-24 23:31 net小伙 阅读(3356) 评论(1) 推荐(0) 编辑
摘要: itoa函数的实现,函数实现功能:输入一个 int 型的数据然后修改成 十六进制的字符串。 例如: 输入 100 输出 0x64主函数:1 int main(void){2 char val[12];3 my_atoi(val,43983);4 printf("%s\n",val);5 return 0;6 }正常的情况下就是使用 传入的num 除以 16,得到余数,然后循环除。但是得到的数据是反的,所以需要再把字符串逆序一下;char change(int num){ if(num > 9) return num+'A'-10; ... 阅读全文
posted @ 2014-03-20 22:54 net小伙 阅读(1948) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 21 下一页