brintos

brintos / linux-shallow public Read only

0
0
Text · 2.0 KiB · f6c6b74 Raw
45 lines · plain
1=============================================2Exporting kernel headers for use by userspace3=============================================4 5The "make headers_install" command exports the kernel's header files in a6form suitable for use by userspace programs.7 8The linux kernel's exported header files describe the API for user space9programs attempting to use kernel services.  These kernel header files are10used by the system's C library (such as glibc or uClibc) to define available11system calls, as well as constants and structures to be used with these12system calls.  The C library's header files include the kernel header files13from the "linux" subdirectory.  The system's libc headers are usually14installed at the default location /usr/include and the kernel headers in15subdirectories under that (most notably /usr/include/linux and16/usr/include/asm).17 18Kernel headers are backwards compatible, but not forwards compatible.  This19means that a program built against a C library using older kernel headers20should run on a newer kernel (although it may not have access to new21features), but a program built against newer kernel headers may not work on an22older kernel.23 24The "make headers_install" command can be run in the top level directory of the25kernel source code (or using a standard out-of-tree build).  It takes two26optional arguments::27 28  make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr29 30ARCH indicates which architecture to produce headers for, and defaults to the31current architecture.  The linux/asm directory of the exported kernel headers32is platform-specific, to see a complete list of supported architectures use33the command::34 35  ls -d include/asm-* | sed 's/.*-//'36 37INSTALL_HDR_PATH indicates where to install the headers. It defaults to38"./usr".39 40An 'include' directory is automatically created inside INSTALL_HDR_PATH and41headers are installed in 'INSTALL_HDR_PATH/include'.42 43The kernel header export infrastructure is maintained by David Woodhouse44<dwmw2@infradead.org>.45