Skip to content
Advertisement

Linux kernel programming: implicit declaration of function ‘vmalloc’

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement