ChinaUnix.net
相关文章推荐:

linux内核模块,用于创建、增加、删除、和遍历一个双向链表

/* * File : hello_mod.c * a simple module example * date : 2005.4.25 */ #include <linux/kernel.h>; #include <linux/module.h>; #if CONFIG_MODVERSIONS==1 //#define MODVERSIONS #include <linux/modversions.h>; #endif int init_module() { printk("hello world\n"); printk("i have running in kernel module\n"); return 1; } int clearup_module() { printk("i will shut down myself in kernel module\n...

by NewCore - 内核/嵌入技术 - 2005-04-29 09:03:49 阅读(647) 回复(9)

相关讨论

平台 redhat 8.0 内核 2.4.18-14 [code] /* hello.c */ /* The necessary header files */ /* Standard in kernel modules */ #include <linux/kernel.h>; /* We're doing kernel work */ #include <linux/module.h>; /* Specifically, a module */ /* Deal with CONFIG_MODVERSIONS */ #if CONFIG_MODVERSIONS==1 #define MODVERSIONS #include <linux/modversions.h>; #endif /* Initialize the module */ int...

by popsmart_410108 - C/C++ - 2005-09-14 20:29:11 阅读(1296) 回复(9)

初学linux Kernel Module Programming 编写了最简单的程序之后, 在使用insmod hello-1.o安装模块的时候, 出现了下面的错误警告信息: ./hello-1.o: kernel-module version mismatch ./hello-1.o was compiled for kernel version 2.4.20 while this kernel is version 2.4.20-8. 曾经有人指点我要修改 /usr/src/linux-2.4/Makefile 这文件, 去掉 EXTRAVERSION = -8custom 这行,然后重新 make dep 就可以了...

by daxi - C/C++ - 2004-08-15 18:36:29 阅读(1007) 回复(8)

我有module,在写数据时要判断介质是否已满。如果已满,需要通知用户空间的进程(daemon)做些事情。通知的迟延越小越好。请问有哪些机制能做到啊?signal可以吗? 很急!多谢知道的大哥指点!

by ljsheng - 内核/嵌入技术 - 2005-06-15 16:34:45 阅读(637) 回复(4)

代码如下。 我的疑惑是:为什么父进程不sleep 60秒,而是随着子进程的结束而结束了?难道是处理SIGCHDL信号导致sleep(60)调用提前结束了吗? [code] #include ; #include ; #include ; #include ; #include ; #include ; #include ; sig_atomic_t child_exit_code; int clean_up_child_processes(int sigNum) { int status; wait(&status); c...

by DirtyBear - C/C++ - 2005-08-24 17:36:15 阅读(1811) 回复(3)

大家给推荐比较简单的,ACE好像有点复杂

by jeffwang8001 - C/C++ - 2006-03-05 10:24:22 阅读(1097) 回复(3)

请问在linux中,如何增加网关?请各位指点

by xiaoer20 - Linux论坛 - 2003-09-06 15:17:38 阅读(556) 回复(5)

我按书上的方法做了,但不行呀,谁指点下啊? #make menuconfig 将需要用的选项,选中为M #make modules 最终结果说未有什么modules发生改变 #make modules_install 报错make:***[_modinst_post] Error 1 #/sbin/modprobe 哪位DX给点意见啊???

by aashen - Linux论坛 - 2004-02-13 14:04:12 阅读(399) 回复(0)

我现在要先创建文件,然后以追加的方式向这文件中写入数据.我的想法是先创建文件,然后再以fopen(文件名,"a")的方式写入.但是我不知道在C中用函数如何创建文件; 由于考虑到性能问题,不想用 1.fopen(文件名,"w")的方式创建,这样要重复打开关闭文件指针; 2.system("dd ...."),这样要重新开辟子进程;

by jiangf - C/C++ - 2009-03-13 18:02:19 阅读(12658) 回复(9)

现在有系统,很多用户,用户没有执行exit而是直接关掉了ssh,所以这用户直在线,我是root用户,请问如何踢掉这用户?

by 千千阙歌 - Linux论坛 - 2005-07-15 14:38:57 阅读(500) 回复(3)

不是rpm包安装的。 是不是只要删除文件夹就可以了?

by text2002 - Linux论坛 - 2004-05-26 17:52:31 阅读(809) 回复(2)