include/asm/unistd_32.h
arch/x86/kernel/syscall_table_32.S
#include <linux/unistd.h>
#define __NR_my_kernel_init 327
//_syscall1(int, my_kernel_init, int, debug);
int my_kernel_init(int debug)
{
return syscall(__NR_my_kernel_init, debug);
}
int main()
{
int ret = my_kernel_init(1);
printf( "%d\n", ret);
return 0;
}
when I using _syscall1(int, my_kernel_init, int, debug), I got an error:
test.c:6: error: expected declaration specifiers or ‘...’ before ‘my_kernel_init’
test.c:6: error: expected declaration specifiers or ‘...’ before ‘debug’
test.c:6: warning: data definition has no type or storage class
Reference:
Linux system call list
Kernel command using Linux system calls, Explore the SCI and add your own calls
Monday, February 9, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment