Linux – Does the kernel itself depend on the standard C libraries

librarieslinux-kernel

I'm looking deeper into how Linux actually works, especially on embedded devices, with all the different components required to make a fully functional system.

I understand that a standard C library implementation such as glibc is separate and is required in order for my user-space application to communicate and hence work together with the Linux Kernel.

However, does the Linux code itself actually depend on this standard library? Can Linux execute by itself without having this?

Best Answer

No, the kernel doesn’t depend on the standard C library (or any other library), it is self-contained. User-space programs don’t necessarily depend on the C library either. The C library provides convenient wrappers for system calls, but they can be called directly without going through the C library, and other language runtimes can provide their own wrappers.

(This does mean that the kernel contains the implementation of quite a few functions which one would usually expect to be provided by the C library, sometimes in simplified versions more appropriate for the kernel. See this kernel newbies FAQ for details.)

Related Question