| klibc | |
|---|---|
| Developer | H. Peter Anvin |
| Stable release | |
| Operating system | Linux |
| Type | Runtime library |
| License | BSD licenses/GPLv2 |
| Website | kernel |
| Repository | |
Incomputing,klibc is a minimalistic subset of thestandard C library developed byH. Peter Anvin. It was developed mainly to be used during theLinux startup process, and it is part of theearly user space, i.e. components used during kernel startup, but which do not run inkernel mode.[2] These components do not have access to the standard library (usuallyglibc ormusl) used by normaluserspace programs.
The development of klibc library was part of the 2002 effort to move some Linux initialization code out of the kernel.[3][4][5] According to its documentation, the klibc library is optimized for correctness and small size.[2] Because of its design, klibc is also technically suitable forembedded software in general on a variety of platforms, and is used even by full-featured programs such as theMirBSD Korn Shell.
During the Linux startup process, klibc is loaded from within a temporaryRAM file system,initramfs. It is incorporated by default into initial RAM file systems that are created by themkinitramfs script inDebian[6] andUbuntu. Furthermore, it has a set of small Unix utilities that are useful inearly user space:cpio,dash, fstype,mkdir,mknod, mount, nfsmount, run-init, etc. all using theklibc library.[7] An alternate strategy is to include everything in one executable, likeBusyBox, which determines the requested applet via arguments or hard links orsymlinks.
klibc is dual-licensed under a BSD three-clause[8] (formerly four-clause, rectified via theHistorical Permission Notice and Disclaimer), as well as the GPLv2 (GPLv2only, due to Linux-kernel restrictions).
This dual license allows compatibility with both non-copyleft software,as well as GPLv3 programsviathe BSD license (which otherwise would not be compatible). (However, if klibc includes any GPLv2 kernel code such as that in glibc, the entire application reverts to GPLv2.)
{{cite web}}:Missing or empty|title= (help)