Where is the system call table in linux kernel? -


i'm reading linux kernel development robert love , 1 of exercises create system call (page 106). problem unable find system call table file in v3.9 x86_32 architecture. know he's using version 2.6.xx don't know if version work distribution i'm using pretty old rather prefer v3.9.

more information: exercise of speaking following: add entry end of system call table.this needs done each architecture supports system call (which, calls, architectures).the position of syscall in table, starting @ zero, system call number. example, tenth entry in list assigned syscall number nine.

solved using following approach: system call table located in arch/x86/syscalls/syscall_32.tbl x86 architecture. sudip mukherjee help.

another approach following: http://lists.kernelnewbies.org/pipermail/kernelnewbies/2013-july/008598.html srinivas ganji too.

create testing folder in src root: src/linux-3.4/testing/, put inside folder:
- file contains syscall code: strcpy.c

#include <linux/linkage.h> #include <linux/kernel.h> asmlinkage long sys_strcpy(char *dest, char *src) {     int i=0;     while(src[i]!='\0') {         dest[i]=src[i++];     }     dest[i]='\0';     printk(" done ");     return 0; } 

and makefile contains following line:

obj-y:=strcpy.o 

add entry syscall table , prototype of function:
- edit file src/linux-3.4/arch/x86/syscalls/syscall_32.tbl adding line entry 223 free

 223        i386    strcpy          sys_strcpy 

edit file src/linux-3.4/include/linux/syscalls.h adding prototype of function

asmlinkage long sys_strcpy(char *dest, char *src); 

edit main makefile in src root (src/linux-3.4/makefile) adding testing folder created before, follow:

core-y      += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ testing/ 

Comments