I am adding system call to Linux kernel 6.22.
#include <stddef.h> #incldue <linux/kernel.h> #include <linux/sched.h> #include <linux/types.h> #include <linux/lists.h> #include <asm-i386/uaccess.h> asmlinkage long sys_mypstree(char* buffer2copy){ char* buffer = (char*)vmalloc(sizeof(buffer2copy)); ... }
Then when i make the kernel.It shows the warning:implicit declaration of function ‘vmalloc’.So,what am i gonna do now?
Advertisement
Answer
You should definitely:
#include <linux/vmalloc.h>
as it will fix your warning.