-   Linux - Newbie (
-   -   Help in System call (

HGaurav 07-28-2009 05:17 AM

Help in System call
I am new to Linux. I just wanted to create a system call. I am using kernel What I did to create a system call is:
1)I created a directory as /usr/src/linux-
2)I created a .c file as /usr/src/linux-
SYSTEM_DEFINE1(mycall, int, i)
return i+10;
3)I created a Makefile file as /usr/src/linux-
obj-y := mycall.o

4) I edited /usr/src/linux-
(original file)
asmlinkage long sys_mycall(void);
5) I edited /usr/src/linux-
(original file)
#define __NR_mycall 333
6) I edited /usr/src/linux-
(original file)
.long sys_mycall /* 333 */

Now finally when I run the command:
[linux-]$make M=mycall/
I get the output as :

CC mycall/mycall.o
mycall/mycall.c:3: error: expected ‘)’ before ‘int’
make[1]: *** [mycall/mycall.o] Error 1
make: *** [_module_mycall] Error 2

Where am I wrong?

I tried for the same system call without any argument then on make I got the result as:

CC mycall/mycall.o
mycall/mycall.c:4: warning: return type defaults to ‘int’
mycall/mycall.c:4: warning: function declaration isn’t a prototype
LD mycall/built-in.o
Building modules, stage 2.
MODPOST 0 modules

y is it so?
Is the procedure I adopted, wrong?
Please help me...

pixellany 07-28-2009 09:48 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

All times are GMT -5. The time now is 11:38 AM.