ahsonbol
November 18th, 2007, 05:58 PM
Hi,
I am trying to add a simple system call. I do all the necessary steps (modifying unistd.h , modifying syscall_table.S,modifying Makefile, build the kernel). I wrote a simple user code to try the new added system call
I got this compilation error
code.c:8: error: expected declaration specifiers or ‘...’ before ‘mycall’
code.c:8: error: expected declaration specifiers or ‘...’ before ‘arg1’
code.c:8: error: expected declaration specifiers or ‘...’ before ‘arg2’
my code is
#include <linux/errno.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <stdio.h>
#define __NR_mycall 320
int _syscall2(int,mycall,int,arg1,int,arg2);
int main()
{
int z;
z=mycall(7,8);
printf("%d\n",z);
return 0;
}
Any help???
I am trying to add a simple system call. I do all the necessary steps (modifying unistd.h , modifying syscall_table.S,modifying Makefile, build the kernel). I wrote a simple user code to try the new added system call
I got this compilation error
code.c:8: error: expected declaration specifiers or ‘...’ before ‘mycall’
code.c:8: error: expected declaration specifiers or ‘...’ before ‘arg1’
code.c:8: error: expected declaration specifiers or ‘...’ before ‘arg2’
my code is
#include <linux/errno.h>
#include <sys/syscall.h>
#include <linux/unistd.h>
#include <stdio.h>
#define __NR_mycall 320
int _syscall2(int,mycall,int,arg1,int,arg2);
int main()
{
int z;
z=mycall(7,8);
printf("%d\n",z);
return 0;
}
Any help???