
The Complete Guide to File Descriptors on Unix and Linux
Learn file descriptors on Unix and Linux from open and close to dup2, fork, pipes, limits, leaks, passing between processes and the kernel tables behind them.
Tag
82 posts

Learn file descriptors on Unix and Linux from open and close to dup2, fork, pipes, limits, leaks, passing between processes and the kernel tables behind them.

Linux has eight namespace types: mount, PID, network, IPC, UTS, user, cgroup and time. Each one gives a process its own view of one kind of kernel resource.

Linux capabilities split root's power into about forty separate privileges, so a process can bind port 80 without being able to load kernel modules.

A guide to shared memory, semaphores and message queues on Linux: POSIX and System V APIs, layout, locking, robust mutexes, crash recovery, limits and cleanup.

Build network protocol parsers and a small TCP/IP stack in C: framing, bounds-safe parsing, state machines, packet buffers, testing, fuzzing and limits.

A full guide to eBPF for network work on Linux: programs, maps, the verifier, XDP, tc, sockets, tracing, testing, debugging and running it safely in production.

Learn I/O multiplexing in C: select, poll, epoll and kqueue compared, with event loops, edge and level triggering, partial I/O, timers and scaling across cores.

Learn how Unix processes work in C on Linux: create them with fork, replace them with exec, collect them with wait, and end them cleanly with exit.

Build a Linux process sandbox layer by layer: drop root and capabilities, add namespaces, seccomp, Landlock, cgroups and systemd limits, then test what escapes.

Learn socket programming in C on Linux from zero: addresses, TCP servers and clients, UDP, getaddrinfo, closing, errors, poll and a working chat server.