C Library

From OSDev Wiki
Jump to navigation Jump to search

The C standard library provides string manipulation (string.h), basic I/O (stdio.h), memory allocation (stdlib.h), and other basic functionality to C programs. The interface is described in the C standard, with further additions described in POSIX as well as vendor extensions. On Unix platforms, the library is named libc and is linked automatically into every executable.

You need a C standard library implementation with the necessary features to run C programs on your operating system. C++ programs can usually use the C standard library as well and the C++ implementation is normally built on top of libc. It is possible to use the C standard interface in a kernel if the library implementation supports this.

Freestanding and Hosted

There are two flavors of the C compilation environment: Hosted, where the