LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1191|回复: 0

想尝试增加系统调用,在编译用户态程序的时候出错

[复制链接]
发表于 2006-12-3 20:15:40 | 显示全部楼层 |阅读模式
然后一编译就出现下面的错误了:(
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表