我正在尝试将math.h包含在我的Linux内核模块中。如果我用了,
#include '/usr/include/math.h'它给了我以下错误:
error: features.h: No such file or directory
error: bits/huge_val.h: No such file or directory
error: bits/mathdef.h: No such file or directory
error: bits/mathcalls.h: No such file or directory为什么会这样呢?
发布于 2009-06-23 14:47:30
在专家看来,这不是一个在内核空间和用户空间之间进行数据通信的好方法。要么完全在内核空间工作,要么只在用户空间上工作。
但是一种解决方案可以在内核模块中使用read()和write()命令在用户空间和内核空间之间发送信息。
发布于 2009-06-18 14:14:46
你不能在内核模块中使用C库,对于数学库部分更是如此。
发布于 2009-06-18 14:23:38
您不能在内核空间中包含用户空间C模块。另外,您确定要这样做吗?这个线程可能会对http://kerneltrap.org/node/16570有所帮助。您可以在内核中执行数学函数,只需在http://lxr.linux.no/上搜索所需的函数即可。
https://stackoverflow.com/questions/1012742
复制相似问题