我开发了一个定制的系统调用来记录终止的进程。C程序杀死进程并调用自定义的系统调用,传递进程的进程ID,然后系统调用将被杀死的进程的ID打印到内核的日志。这里,我只是传递一个虚拟来测试系统调用是否写入内核日志。系统调用表中的系统调用号为329。
下面是我的系统呼叫
#include <linux/kernel.h>
asmlinkage long sys_killa(char* proc_id)
{
printk("The process %s has been killed", proc_id);
return 0;
}
这是我的C程序来调用
作为初学者,我正在学习编写linux内核模块。我要做的是使用DFS算法将每个任务及其子进程写入内核日志。但是当我使用Makefile编译代码时,它显示了上面的错误:
function declaration isn’t a prototype [-Werror=strict-prototypes]
struct task_struct *current;
它指出函数DFS中的task_struct关键字。这是我的密码:
# include <linux/init.h>
# include <linux/kernel.h>
# include <linux/modu
在尝试运行GLIBCXX版本时,我在同一台机器上编译、链接和运行的程序怎么可能出现错误呢?有人知道吗?
下面是我遇到的错误:
0.01s$ build/test/gamgee_test
build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by build/test/gamgee_test)
build/test/gamgee_test: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: v