Linux内核编程:函数“的vmalloc'的隐式声明 [英] Linux kernel programming:implicit declaration of function 'vmalloc'

查看:744
本文介绍了Linux内核编程:函数“的vmalloc'的隐式声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加系统调用Linux内核6.22。

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));
     ...
}

然后当我做出kernel.It显示警告:函数'vmalloc'.So隐含的声明,我是什么,现在该怎么办

Then when i make the kernel.It shows the warning:implicit declaration of function 'vmalloc'.So,what am i gonna do now?

推荐答案

您可一定要:
结果的#include&LT; Linux的/ vmalloc.h方式&gt; ,因为它会解决你的警告

You should definitely:
#include <linux/vmalloc.h> as it will fix your warning.

这篇关于Linux内核编程:函数“的vmalloc'的隐式声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆