Re: error of proc_register()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>      In my userland code, I change new system call
> our_sys_open("mytest", O_RDONLY, 0444); into
>   #include <unistd.h>
>   ...
> _syscall3(errno, "our_sys_open", name, "mytest", filename, O_RDONLY,
> flags, 0444);
>   ...

this is how the macro will look like
_syscall3(type,name,type1,arg1,type2,arg2,type3,arg3); 

type - return type(int,long etc)
name - function name (in ur case our_sys_open not "our_sys_open")
type 1 - type of 1st argument (int, struct something *,etc)
arg1 - first argument of ur system call.(in ur case mytest not "mytest")
type 2 - same like above
arg2 -    "
type 3 - "
arg 3 -   "

refer asm/unistd.h for the macro.

the statement should like
_syscall3(int,our_sys_open,<data type of mytest>,mytest,<data 
type>,O_RDONLY,<data type>,0444);

dont use any double quotes like "our_sys_call" that is our_sys_call
and "mytest" should be simply mytest

> the compilation still gives me error: undefined reference to `_syscall3'
>
> I guess there is something I am still missing,
> -Hong
dont forget to include asm/unistd.h

if u still have trouble i will send u some code.because putting the whole 
code here will waste everyone's disk space.i have done similar kinda work.

regards,
mohan.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux