Re: Help Adding system call 2.6.19

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

 



> Hi, I am trying to add a new system call in linux kernel 2.6.19.
> Adding all the required kernel code is fine but compilation of user
> space code is giving some issues.
>
> The _syscall0, _syscall1, .... interface that was available till
> 2.6.17 seems to have been discontinued. _syscall0... marcos are
> defined in asm-i386/unistd.h but inside kernel block.
>
> Can anybody give me some pointers as to how system call are to be
> invoked 2.6.18 onwards?

This is what I use:

 /* stupid hack to get _syscall0() and _syscall3() macros */
 #define __KERNEL__
 #include <linux/unistd.h>
 #undef __KERNEL__

Not nice, but it works.

Hmm .. I am wondering if GLIBC would be doing it some other way :-)

But anyway, why were the _syscall(s) put under #ifdef __KERNEL__?
Since it is not correct to use syscalls from within the kernel,
wouldn't it be more appropriate to define _syscall(s) when __KERNEL__
is NOT defined?

#ifndef __KERNEL__

#define syscall0 etc etc

#endif

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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