作者dces4212 (flawless)
看板LinuxDev
标题[问题] Kernel module 相关问题
时间Sun Mar 17 20:32:15 2019
想请教各位大大,kernel module 里面是不是不能用到 kernel header 以外的 include
path?目前想把 stdint.h 引用进去,可是发现 kernel header 里面的 stdint.h 内容
跟 /usr/include 那边的stdint.h 不一样,而且直接引用会出错(include_next 相关),
可是假如强制喂给 make (-I/use/include) 又会有重复宣告的问题,网路上看到有人这
样解决...。不知道想引用的话是不是有专门的方法呢?
谢谢大家!
手机发文,伤眼抱歉!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 101.12.20.170
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/LinuxDev/M.1552825937.A.1EB.html
1F:→ james732: user space与kernel space的header本来就是分开的吧?03/17 20:49
2F:→ dces4212: 感谢回覆。所以换句话说,kernel module 里面不会有用03/17 22:22
3F:→ dces4212: 到stdint.h的程式码嘛?这样 kernel header 那边的 stdi03/17 22:22
4F:→ dces4212: nt.h 是专用来做什麽的吗?03/17 22:22
※ 编辑: dces4212 (101.12.20.170), 03/17/2019 22:23:04
※ 编辑: dces4212 (101.12.20.170), 03/17/2019 22:23:47
5F:→ wens: 你要 stdint.h 干嘛? 03/18 17:12
6F:推 yvb: 改 #include <linux/types.h> ? 03/20 15:33
7F:→ yvb: 啊, 其实 #include <linux/kernel.h> 也包含了. 03/20 15:43
8F:→ dces4212: 後来发现我应该要用kernel专用的资料型态(u32, u64...e) 03/27 02:58
9F:→ dces4212: *etc 03/27 02:58
10F:→ dces4212: 感谢两位大大 03/27 02:59