i am writing a custom system call for linux kernel everything works fine with the function call and now i am trying to create a wrapper function in order to use the function normally in any program without using the syscall (call)
what i have done so far is
#include <stdlib.h>
#include<stdio.h>
#include<linux/unistd.h>
#include<errno.h>
#include <sys/types.h>
#include <unistd.h>
#include<string.h>
#include <linux/sched.h>
#include <linux/kernel.h>
long *__wrap_process_info(int myid , void *udata)
{
return syscall(337 , myid , udata);
}
my system call returns -1 on error and 0 if executed correctly my question is , how to make the wrapper function return the syscall return value ? and ,do i need to include a main in the wrapper function ?