IPC and lib Functions
Inter-Process Communication and library functions have two small directories dedicated to them.
The ipc directory includes a generic file called
util.c and one source file for each communication facility:
sem.c, shm.c, and msg.c. msg.c is
in charge of message queues and the kerneld engine,
kerneld_send. If IPC is not enabled at compile time,
util.c exports empty functions that implement
IPC-related system calls by returning -ENOSYS.
The library functions are like the utilities and variables that you
usually use in C
programs: sprintf, vsprintf, the errno integer
variable, and the _ctype array used by the various
<linux/ctype.h> macros. The file string.c
contains portable implementations of the string functions, but
they are compiled only if the architecture-specific code
does not include optimized inline functions. If the inline functions are
defined in the header, the implementations in string.c are
left out of the game by #ifdef statements.
The most ``interesting'' file in lib is inflate.c, which
is the ``gunzip'' part of gzip, extracted from gzip itself
to allow using a compressed RAM disk at boot time. This technique is used
whenever the needed data wouldn’t fit on a floppy unless compressed.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access