Appendix E: Glossary
Definitions of key terms used throughout this book.
ABI (Application Binary Interface)
The low-level contract between compiled code: calling conventions, register
usage, struct layout, name mangling. If two object files follow the same ABI,
they can be linked together. C has a stable ABI on most platforms; Rust does
not (use extern "C" for FFI).
Alignment
The requirement that data sit at memory addresses that are multiples of a
certain value (typically the type's size). A uint32_t usually requires
4-byte alignment. Misaligned access is undefined behavior in C on some
architectures and always a performance penalty.
Arena Allocator A memory allocator that bumps a pointer forward for each allocation and frees all allocations at once. Zero fragmentation, zero per-object overhead, very fast. Useful for parsers, request handlers, and game loops. See Chapter 51.
Async (Asynchronous I/O)
A programming model where I/O operations don't block the calling thread.
Instead, the program registers interest in events and is notified when they
complete. Linux provides epoll, io_uring, and aio for async I/O. Rust's
async/await builds on epoll via runtimes like tokio.
Atomic Operation
An operation that completes indivisibly -- no other thread can see it
half-done. Used for lock-free synchronization. C provides <stdatomic.h>;
Rust provides std::sync::atomic. See Chapter 52.
Borrow Checker Rust's compile-time system that enforces ownership rules: one mutable reference or any number of shared references, but not both simultaneously. Prevents data races and use-after-free at compile time.
Callback
A function pointer passed to another function, to be called later. Used
extensively in C APIs (signal handlers, thread start routines, comparators
for qsort). In Rust, closures serve the same purpose with type safety.
Condition Variable
A synchronization primitive that allows threads to wait until a condition
becomes true. Always used with a mutex. C: pthread_cond_t. Rust:
std::sync::Condvar. See Chapter 45.
Container_of
A C macro (used extensively in the Linux kernel) that takes a pointer to a
struct member and returns a pointer to the containing struct. Relies on
offsetof. Essential for intrusive data structures like list_head.
Copy Semantics
In C, assignment copies all bytes of a struct (shallow copy). In Rust, types
that implement the Copy trait are copied on assignment; other types are
moved (ownership transfer). See Chapter 9.
Daemon
A background process with no controlling terminal. Created by forking, calling
setsid, and closing stdin/stdout/stderr. System services (sshd, nginx,
systemd) are daemons. See Chapter 34.
Data Race Two or more threads access the same memory location concurrently, at least one is a write, and there's no synchronization. Undefined behavior in both C and Rust. Rust's type system prevents data races at compile time.
Deadlock A situation where two or more threads are each waiting for the other to release a resource. Thread A holds lock 1 and waits for lock 2; Thread B holds lock 2 and waits for lock 1. Neither can proceed.
DMA (Direct Memory Access) Hardware that transfers data between devices and memory without CPU involvement. Kernel drivers set up DMA buffers and descriptors; the hardware reads/writes directly. Requires careful cache management and memory alignment.
Endianness
Byte order within multi-byte values. Big-endian: most significant byte first
(network byte order). Little-endian: least significant byte first (x86, ARM
default). Use htons/ntohs for conversion. See Chapter 11.
epoll
Linux's scalable I/O event notification mechanism. Monitors many file
descriptors efficiently with O(1) per event. Three syscalls: epoll_create1,
epoll_ctl, epoll_wait. See Chapter 49.
errno A thread-local integer set by system calls and library functions on failure. Check it immediately after a call returns an error. Reset it before calling functions that may or may not set it. See Appendix A.
File Descriptor An integer index into the kernel's per-process table of open files, sockets, pipes, and devices. 0 = stdin, 1 = stdout, 2 = stderr. The fundamental I/O abstraction in Unix. See Chapter 28.
Fork
The fork() syscall creates a new process by duplicating the calling process.
The child gets a copy of the parent's memory (via copy-on-write). Returns 0
in the child, the child's PID in the parent. See Chapter 32.
Futex (Fast Userspace Mutex)
A Linux-specific synchronization primitive. Uncontended operations stay in user
space (fast). Contended operations trap to the kernel to sleep. The building
block for pthread_mutex_t. See Chapter 44.
GFP Flags
Kernel memory allocation flags (GFP_KERNEL, GFP_ATOMIC, etc.) that tell
the allocator what context the allocation occurs in. Using the wrong flag
(e.g., GFP_KERNEL in interrupt context) causes deadlocks.
Inode The kernel data structure that represents a file on disk. Contains metadata (permissions, timestamps, size, block pointers) but not the filename. Multiple filenames (hard links) can point to the same inode.
ioctl (I/O Control)
A catch-all system call for device-specific operations that don't fit the
read/write model. Takes a file descriptor, a request number, and an
optional argument. See Chapter 54.
IPC (Inter-Process Communication) Mechanisms for processes to exchange data: pipes, FIFOs, Unix domain sockets, shared memory, message queues, signals, netlink. See Chapters 34, 40.
Lifetime (Rust)
A compile-time annotation that tracks how long a reference is valid. Written as
'a in type signatures. The borrow checker uses lifetimes to prevent dangling
references. No runtime cost.
mmap (Memory Map)
The mmap() syscall maps files or devices into a process's address space.
Also used for anonymous memory allocation and shared memory between processes.
See Chapter 39.
Move Semantics
In Rust, assigning a value to a new variable transfers ownership. The original
variable becomes invalid. Prevents double-free and use-after-free. Types that
implement Copy are exempt (they're bitwise copied instead).
Mutex (Mutual Exclusion)
A synchronization primitive that ensures only one thread accesses a critical
section at a time. C: pthread_mutex_t. Rust: std::sync::Mutex<T> (data
is inside the mutex, enforced by the type system). See Chapter 44.
Netlink A socket-based IPC mechanism between the Linux kernel and user-space processes. Used for network configuration, device events, and other kernel communication. See Chapter 55.
Opaque Type A type whose internal layout is hidden from users. In C, declared as a forward struct declaration with access only through function pointers. In Rust, achieved with module visibility. See Chapter 20.
Ownership (Rust) Rust's core memory management concept: every value has exactly one owner. When the owner goes out of scope, the value is dropped (freed). Ownership can be transferred (moved) or temporarily lent (borrowed).
POSIX (Portable Operating System Interface) The IEEE standard defining the API for Unix-like operating systems. Covers system calls, shell utilities, and C library functions. Linux is "mostly POSIX-compliant."
Race Condition A bug where the program's behavior depends on the timing of events (typically thread scheduling). Includes data races but also higher-level logic races (TOCTOU: time-of-check-to-time-of-use).
RAII (Resource Acquisition Is Initialization)
A pattern where resources (memory, files, locks) are tied to object lifetime.
Acquired in the constructor, released in the destructor. C++ and Rust use this
heavily. C requires manual cleanup (often with goto chains).
Reactor Pattern An event-driven design where a central event loop waits for I/O events and dispatches them to handlers. Used by epoll-based servers, tokio, and most high-performance network servers. See Chapter 49.
Semaphore
A synchronization primitive with a counter. wait() decrements (blocking if
zero); post() increments (waking a waiter). Binary semaphore acts like a
mutex. Counting semaphore limits concurrent access. C: sem_t. See Chapter 45.
Signal
An asynchronous notification sent to a process. Examples: SIGTERM (terminate),
SIGSEGV (segfault), SIGINT (Ctrl+C), SIGCHLD (child exited). Handled
by signal handlers or signalfd. See Chapters 35-37.
Slab Allocator
The Linux kernel's pool allocator for fixed-size objects. Uses kmem_cache
structures. Pre-allocates pages, divides them into same-size slots, and
maintains free lists. The kernel equivalent of the pool allocator in Chapter 51.
Socket An endpoint for network communication. Identified by a file descriptor. Types: stream (TCP), datagram (UDP), raw, Unix domain. See Chapters 47-49.
Spinlock A lock that busy-waits (spins) instead of sleeping. Appropriate when the expected hold time is very short and sleeping would be more expensive than spinning. Used in the kernel for interrupt-context synchronization.
Syscall (System Call)
The interface between user-space programs and the kernel. Invoked via the
syscall instruction (x86-64). Each has a number (e.g., write = 1 on
x86-64). libc wraps syscalls in C functions. See Appendix C.
Thread-Safe Code that can be called simultaneously from multiple threads without data corruption. Achieved through synchronization (mutexes, atomics) or by avoiding shared mutable state.
TOCTOU (Time-of-Check-to-Time-of-Use)
A race condition where the state checked by a program changes before the
program acts on it. Example: checking file permissions with access(), then
opening the file -- an attacker can swap the file in between.
Trait (Rust)
An interface definition. Like a C vtable or a Java interface, but resolved at
compile time (static dispatch) or runtime (dynamic dispatch with dyn Trait).
Key traits: Read, Write, Iterator, Display, Debug, Clone, Copy.
Undefined Behavior (UB) Code whose behavior is not defined by the language standard. The compiler may do anything: crash, produce wrong results, appear to work, or format your hard drive. Common C causes: null dereference, buffer overflow, signed integer overflow, use-after-free, data races.
Volatile
A C qualifier that prevents the compiler from optimizing away or reordering
accesses to a variable. Used for memory-mapped I/O registers. Does NOT provide
atomicity or prevent CPU reordering. Not the same as atomic.
VFS (Virtual File System)
The kernel's abstraction layer that provides a uniform file interface over
different filesystems (ext4, procfs, sysfs, tmpfs). All file operations go
through VFS, which dispatches to the specific filesystem's file_operations.
Vtable (Virtual Function Table)
A table of function pointers used for runtime polymorphism. In C, built
manually as a struct of function pointers. In Rust, generated automatically
for dyn Trait objects. In the kernel, file_operations and
platform_driver are vtables.
Zero-Copy
Transferring data without copying it between buffers. Techniques: sendfile,
splice, mmap, io_uring, and in-place parsing. Eliminates CPU and cache
overhead of memcpy. See Chapter 52.