0001 =============================================
0002 Exporting kernel headers for use by userspace
0003 =============================================
0004
0005 The "make headers_install" command exports the kernel's header files in a
0006 form suitable for use by userspace programs.
0007
0008 The linux kernel's exported header files describe the API for user space
0009 programs attempting to use kernel services. These kernel header files are
0010 used by the system's C library (such as glibc or uClibc) to define available
0011 system calls, as well as constants and structures to be used with these
0012 system calls. The C library's header files include the kernel header files
0013 from the "linux" subdirectory. The system's libc headers are usually
0014 installed at the default location /usr/include and the kernel headers in
0015 subdirectories under that (most notably /usr/include/linux and
0016 /usr/include/asm).
0017
0018 Kernel headers are backwards compatible, but not forwards compatible. This
0019 means that a program built against a C library using older kernel headers
0020 should run on a newer kernel (although it may not have access to new
0021 features), but a program built against newer kernel headers may not work on an
0022 older kernel.
0023
0024 The "make headers_install" command can be run in the top level directory of the
0025 kernel source code (or using a standard out-of-tree build). It takes two
0026 optional arguments::
0027
0028 make headers_install ARCH=i386 INSTALL_HDR_PATH=/usr
0029
0030 ARCH indicates which architecture to produce headers for, and defaults to the
0031 current architecture. The linux/asm directory of the exported kernel headers
0032 is platform-specific, to see a complete list of supported architectures use
0033 the command::
0034
0035 ls -d include/asm-* | sed 's/.*-//'
0036
0037 INSTALL_HDR_PATH indicates where to install the headers. It defaults to
0038 "./usr".
0039
0040 An 'include' directory is automatically created inside INSTALL_HDR_PATH and
0041 headers are installed in 'INSTALL_HDR_PATH/include'.
0042
0043 The kernel header export infrastructure is maintained by David Woodhouse
0044 <dwmw2@infradead.org>.