【发布时间】:2011-08-11 22:02:45
【问题描述】:
我做了一个没有参数的基本 helloWorld 系统调用示例,只是:
int main()
{
syscall(__NR_helloWorld);
return 0;
}
但现在我想弄清楚如何将实际参数传递给系统调用(即long)。究竟是什么格式,我试过了:
int main()
{
long input = 1;
long result = syscall(__NR_someSysCall, long input, long);
return 0;
}
它需要一个long 并返回一个long,但编译不正确;正确的语法是什么?
【问题讨论】:
标签: c linux kernel parameter-passing system-calls