我已经编写了一个自定义设备驱动程序作为树状内核模块。 此设备驱动程序定义用户空间应用程序所需的一组ioctl。 ioctl在自定义头文件中定义。
应该安装此头文件的标准位置是什么? 这应该是/usr/include吗? 或者也许安装标准内核包含文件的位置相同?
我已阅读此问题,但它没有指定应安装自定义头文件的位置。
I have written a custom device driver as an out of tree kernel module. This device driver defines a set of ioctls that are needed by user space applications. The ioctls are defined in a custom header file.
What is the standard location where this header file should be installed? Should this be /usr/include? Or perhaps the same location where the standard kernel include files are installed?
I have read this question but it does not specify where the custom header files should be installed.
最满意答案
我认为您应该像处理其他任何内容一样处理您的公共用户空间API标头,并将它们放在/usr/include 。 如果它是一个小API,则作为单个文件,或者在子目录中。 只需确保只提供该标题中的必要部分,而不是实现细节。 如果您要为开发人员生成Linux软件包,通常将其命名为foo-dev(APT / Ubuntu)或foo-devel(YUM / RHEL)。
I think you should treat your public user-space API headers like any others, and put them under /usr/include. Either as a single file if it's a small API, or in a subdirectory. Just make sure to provide only the necessary pieces in that header, and not the implementation details. If you're going to produce a Linux package for developers, you'd usually name it like foo-dev (APT/Ubuntu) or foo-devel (YUM/RHEL).
更多推荐
发布评论