The smallest directories (in size) in the Linux source tree are
ipc
and lib
. The former is
an implementation of the System V interprocess communication
primitives, namely semaphores, message queues, and shared memory; they
often get forgotten, but many applications use them (especially shared
memory). The latter directory includes generic support functions,
similar to the ones available in the standard C library.
The generic library functions are a very small subset of those
available in user space, but cover the indispensable things you
generally need to write code: string functions (including
simple_atol to convert a string to a
long
integer with error checking) and
<ctype.h>
functions. The most important file
in this directory is vsprintf.c
; it implements
the function by the same name, which sits at the core of
sprintf and printk. Another
important file is inflate.c
, which includes the
decompressing code of gzip.