开发者

Export kernel module headers to userspace

开发者 https://www.devze.com 2023-03-08 17:53 出处:网络
I am writing a Linux kernel module which need to export some header files to userspace. I am wondering if there is any standard method which use Kernel package to do required sanitation of headers (F

I am writing a Linux kernel module which need to export some header files to userspace.

I am wondering if there is any standard method which use Kernel package to do required sanitation of headers (For example something like "$(MAKE) -C $(KERNELDIR) M=$(开发者_如何转开发PWD) headers_install" if exist).

Should i take care of headers manually? Any suggestion?


There is no such functionality out of the box because most kernel modules which need something like that come with an extra "devel" package which contains the (cleaned) header files and probably a shared library to talk to the module.

As for cleaning your headers, I suggest to split the header files into a generic part (which you export) and an internal part (which only the kernel module can see). typedef is your friend.


You can do it by adding 'header-y=' to one of the Kbuild under /include/uapi

0

精彩评论

暂无评论...
验证码 换一张
取 消