What is GLIBC? What is it used for? What is GLIBC? What is it used for? c c

What is GLIBC? What is it used for?


Its the implementation of Standard C library described in C standards plus some extra useful stuffs which are not strictly standard but used frequently.

Its main contents are :

1) C library described in ANSI,c99,c11 standards. It includes macros, symbols, function implementations etc.(printf(),malloc() etc)

2) POSIX standard library. The "userland" glue of system calls. (open(),read() etc. Actually glibc does not "implement" system calls. kernel does it. But glibc provides the user land interface to the services provided by kernel so that user application can use a system call just like a ordinary function.

3) Also some nonstandard but useful stuff.

"use the force, read the source "

$git clone git://sourceware.org/git/glibc.git

(I was recently pretty enlightened when i looked through malloc.c in glibc)


There are several implementations of the standard. Glibc is the implementation that most Linuxes use, but there are others. Glibc also contains (as Aftnix states) the glue functions which set up the scene for jumps into the kernel (also known as system calls). So many of glibc's 'functions' don't do the actual work but only delegate to the kernel.

To read the source of Glibc, just google for it. There are myriad sites which carry it, and also several variations.

Windows uses Microsoft's own implementation, which I believe is called MSVCR.DLL. I doubt that you will find the source code to that library anywhere. Also note that some functions which a Linux hacker might think of as 'standard', simply don't exist on Windows (notably fork). The reverse is also true.

Other systems will have their own libc.


The glibc package contains standard libraries which are used by multiple programs on the system. In order to save disk space and memory, as well as to make upgrading easier, common system code iskept in one place and shared between programs. This particular package contains the most important sets of shared libraries: the standard C library and the standard math library. Without these two libraries, a Linux system will not function. The glibc package also contains national language (locale) support.