|
然后一编译就出现下面的错误了:(
test_mysyscall.c:3: error: expected declaration specifiers or ‘...’ before ‘
mysyscall’
test_mysyscall.c:5: warning: return type defaults to ‘int’
test_mysyscall.c: In function ‘_syscall0’:
test_mysyscall.c:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘
__attribute__’ before ‘{’ token
test_mysyscall.c:3: error: parameter name omitted
test_mysyscall.c:11: error: expected ‘{’ at end of input
我想应该是_syscall0(int, mysyscall)
这里不对,man _syscall,发现下面这句话,但不是很懂什么意思:
NOTES
The _syscall() macros DO NOT produce a prototype. You may have to cre‐
ate one, especially for C++ users.
不知道有没有关系?
我用的是Ubuntu 6.10, 原来内核的版本是2.6.17,实验使用的新内核源码是2.6.19
gcc版本是:4.1.2 |
|