[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: New system call and User space header file
On 9/8/07, Sachin Gaikwad <sachin.kernel@xxxxxxxxx> wrote:
> Hi all,
>
> If I am adding a new system call sys_myroutine into the kernel then why is
> it necessary to have header file in user space like this -
>
> #include <unistd.h>
>
> _syscall2(int, myroutine, int arg1, int, arg2);
>
> What does it do when a user program calls this system call ? Can somebody
> explain this to me ?
Have a look at linux/unistd.h, _syscall2 is a macro that expands to:
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) { return syscall(__NR_##name,
arg1, arg2); }
#endif
And syscall() performs the actual system call.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ