I am on Centos 6.5 and implemented a new demo system call on linux kernel 3.13.2.
For this I changed the
- syscall_32.tbl
Appended this in the end
Code:
351 i386 helloworld sys_helloworld
- sys.c
Defined my function in this file
Code:
asmlinkage long sys_helloworld(int fd)
{
printk(KERN_EMERG "Hello, world! from Vivek\n");
return fd+1;
}
- syscalls.h
Added this before last #endif
Code:
asmlinkage long sys_helloworld(int fd);
Then compiled and installed the new kernel. Everything is fine and working.
To test my system call, I used this program
Code:
#include <stdio.h>
#include <linux/kernel.h>
#include <sys/syscall.h>
#include <unistd.h>
int main()
{
int fd;
fd = syscall(351, 5);
printf("\n%d", fd);
return 0;
}
Now when I trace the test program in
strace it shows the output like this
the last call SYS_351 is my new system call.
I want to know why the name of my system call is not shown like others above in this picture?? Is there any other changes required to do that.??