?? readme.kthread1
字號:
A very simple kthread example - a very dangorouse kthread example.The kernel thread is only invoced to call execve and thats it - as it inheritsthe environment of the user that launched the insmod ktherd1.o (you) the echogoes to the this users console. basically this is nothing else than the kthread equivalent of the fairly useless userspace uthread1 (well its not athread but...).---uthread1.c---#include <unistd.h> char cmd_path[256] = "/bin/echo";char main_arg[] ="Hello User World";main(){ static char * envp[] = { "HOME=/root", "TERM=linux", "PATH=/bin", NULL }; char *argv[] = { cmd_path, main_arg, NULL }; int ret; printf("calling execve for %s \n",cmd_path); ret = execve(cmd_path, argv, envp); /* if we ever get here - execve failed */ printf("failed to exec %s, ret = %d\n", cmd_path,ret); return -1;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -