我正在使用内核版本为2.8.32的Ubuntu 9.04。我创建了一个简单的系统调用,用于计算clone和execve调用的数量。当用户/Shell调用此系统调用时,我希望它将这两个值传递回用户。目前我正在使用以下命令:
#include <linux/sched.h>
#include <linux/asmlinkage>
/* These two variables are extern longs which are defined in sched.h and initialized in process_32.c */
total_execve;
total_clones;
long mycall* (int i){
int array[2];
array[0] = total_execve;
array[1] = total_clones;
return array;
}
我无法编译这个代码,因为出现了未定义的引用错误。
关于返回数组:我的新调用是否能够访问该数组?该数组不会位于内核内存中吗?