$linuxjunkies
>

libc

also: glibc, GNU libc, standard C library, C runtime library

The C standard library (libc) is a core system library providing essential functions for C programs, including I/O, memory management, string handling, and system calls. It acts as the primary interface between user programs and the Linux kernel.

libc is the standard C library implementation on Linux systems, most commonly GNU libc (glibc). It provides hundreds of standard functions defined in the C language specification, allowing programs to perform common operations without reimplementing basic functionality.

The library handles critical tasks like printf() for output, malloc() for memory allocation, open() and read() for file operations, and fork() for process creation. For example, when you call printf("Hello\n"), you're using a libc function that formats the string and ultimately calls kernel system calls to write to output.

Most compiled C programs dynamically link against libc at runtime. You can see which version your system uses with ldd /bin/ls, which shows that executable depends on libc.so.6. Alternative implementations like musl exist for embedded or security-focused systems.

Related terms