views:

86

answers:

2

Hi,

when i search for adding a system call, i get many articles but they seem to be for old versions, it also seems like a trivial process.

But the problem is, the directories that articles suggest does not hold for the version 2.6.31. does anyone know where unistd.h, syscall_table.S and syscalls.h or their corresponding files are?

Thanks in advance.

A: 

On most Linux systems such header files can be found under:

/usr/src/kernels/$KERNEL-VERSION/include/linux/

You need to have your kernel sources installed to be able to do any kernel development though, if that's what're trying to do, since unistd.h is part of the standard gcc library as well.

Bozhidar Batsov
Now, i downloaded source of 2.6.31 and extracted it. i want to add a system call to this source then build and install it. What you're saying is that this is impossible? else, inside this source, where is those files, i found unistd.h and syscalls.h there. Are those the ones to modify?
mustafabattal
You'd do a lot better is you download the sources as a distro package, make the modifications and rebuild the packages. Building and installing a custom kernel from vanilla sources is not always a good idea, especially if you're not very familiar with the underlying distribution. I've worked as a kernel developer for time so I should know :-)
Bozhidar Batsov
A: 

for unistd.h : $SOURCE_PATH/arch/x86/include/asm/unistd_32.h

for syscalls.h : $SOURCE_PATH/arch/x86/include/asm/syscalls.h

for syscall_table_32.h : $SOURCE_PATH/arch/x86/kernel/syscall_table_32.h

obviously i'm on x86 machine.

mustafabattal