Klibc
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, klibc is a minimalistic subset of the standard C library
C standard library
The C Standard Library is the standard library for the programming language C, as specified in the ANSI C standard.. It was developed at the same time as the C POSIX library, which is basically a superset of it...

 developed by H. Peter Anvin. It was developed mainly to be used during the Linux startup process
Linux startup process
The Linux startup process is the process of Linux-operating system initialization. It is in many ways similar to the BSD and other Unix style boot processes, from which it derives.-Overview of typical process:...

, and it is part of the early user space, i.e. components used during kernel startup, but which do not run in kernel mode. These components do not have access to the standard library (usually glibc
GNU C Library
The GNU C Library, commonly known as glibc, is the C standard library released by the GNU Project. Originally written by the Free Software Foundation for the GNU operating system, the library's development has been overseen by a committee since 2001, with Ulrich Drepper from Red Hat as the lead...

) used by normal userspace programs.

The development of klibc library was part of the 2002 effort to move some Linux initialization code out of the kernel. According to its documentation, the klibc library is optimized for correctness and small size. Because of its design, klibc is also technically suitable for embedded software
Embedded software
Embedded software is computer software that plays an integral role in the electronics it is supplied with.Embedded software's principal role is not Information technology , but rather the interaction with the physical world. It's written for machines that are not, first and foremost, computers...

 in general, and even some full-featured programmes such as the MirBSD Korn Shell. Unlike many other open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 libraries, klibc is licensed under the full GPL
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

 license, which (unlike LGPL) imposes itself on any code linked with it. (This only applies to klibc as a whole due to embedding some Linux kernel derived files; most of the library source code is actually available under a BSD licence
BSD licenses
BSD licenses are a family of permissive free software licenses. The original license was used for the Berkeley Software Distribution , a Unix-like operating system after which it is named....

 from UCB or the Historical Permission Notice and Disclaimer
Historical Permission Notice and Disclaimer
The Historical Permission Notice and Disclaimer is an open source license, approved by the Open Source Initiative . It is unique among the OSI's licenses because of the choices it allows in its construction; it lets the licensor pick anywhere from 0-2 warranty disclaimers, whether they want to...

.) This may limit its applicability to commercial embedded software.

During the Linux startup process, klibc is loaded from within a temporary RAM file system
TMPFS
tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems. It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device...

, initramfs. It is incorporated by default into initial RAM file systems that are created by the mkinitramfs script in Debian
Debian
Debian is a computer operating system composed of software packages released as free and open source software primarily under the GNU General Public License along with other free software licenses. Debian GNU/Linux, which includes the GNU OS tools and Linux kernel, is a popular and influential...

  and Ubuntu
Ubuntu (operating system)
Ubuntu is a computer operating system based on the Debian Linux distribution and distributed as free and open source software. It is named after the Southern African philosophy of Ubuntu...

. Furthermore it has a set of small Unix utilities that are useful in early user space: cpio
Cpio
cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. The software utility was originally intended as a tape archiving program as part of the Programmer's Workbench , and has been a component of virtually every...

, dash
Debian Almquist shell
The Debian Almquist shell is a Unix shell, much smaller than bash but still aiming at POSIX-compliancy. It requires less disk space but is also less feature-rich.- History :...

, fstype, mkdir
Mkdir
The mkdir command in the Unix, DOS, OS/2 and Microsoft Windows operating systems is used to make a new directory. In DOS, OS/2 and Windows the command is often abbreviated to md.-Usage:Normal usage is as straightforward as follows:...

, mknod, mount, nfsmount, run-init, etc. all using the klibc library. . An alternate strategy is to include everything in one executable, like BusyBox
BusyBox
BusyBox provides several stripped-down Unix tools in a single executable. It runs in a variety of POSIX environments such as Linux, Android, FreeBSD and others, such as proprietary kernels, although many of the tools it provides are designed to work with interfaces provided by the Linux kernel. It...

, which determines the program via arguments or a symlink
Symbolic link
In computing, a symbolic link is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution. Symbolic links were already present by 1978 in mini-computer operating systems from DEC and Data...

.

Other klibc

kLIBC and kNIX appears to be a SUS/C99 environment for OS/2.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK