Where are the files necessary to modify when adding a system call to linux-2.6.31
-
27-09-2019 - |
Question
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.
Solution
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.
OTHER TIPS
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.