Systems Programming · Cluster
OS Interfaces
Files, sockets, and process control.
- 01 What a File Descriptor Is: An Index Into a Process Table The descriptor is a small integer indexing a per-process array of pointers, and that indirection explains dup, fork, close, and the shared-offset bugs that follow from each.
- 02 Readiness Notification: What select, poll, and epoll Actually Report All three interfaces answer the same question about whether an operation would block, but they differ in how much work the kernel does per call and in what a returned descriptor guarantees.
- 03 Short Counts: Why read and write Return Less Than Asked A successful read or write may transfer fewer bytes than requested, and the reasons differ by object type. The cases differ by object type, and each needs a loop that distinguishes end-of-file, interruption, and a partial transfer.
- 04 fork and exec: Which Descriptors Survive and Why Between fork and exec a child inherits every open descriptor, and only a per-entry flag can prevent it. The inheritance rules, the leak they cause, and the atomicity problems that follow from closing descriptors after the fact.
- 05 Exit Status, Zombies, and What waitpid Can Tell a Parent A terminated process leaves a status word and an entry that must be reaped. Status encoding, the reason the record survives termination, and the four ways a parent can wait without deadlocking.
- 06 Signals: Delivery, Interruption, and the Async-Signal-Safe Set A signal handler runs on the thread it interrupted, with that thread half-finished, which is why only a small set of functions may be called from one. Delivery, masking, and the self-pipe pattern follow from the handler running on an interrupted thread.
- 07 UNIX Domain Sockets and Passing File Descriptors A socket in the filesystem namespace carries data without a network stack, and its control-message channel can hand a descriptor to another process. Address formats, the credential channel, and what a descriptor transfer actually copies.
- 08 mmap and the Page-Fault Path: What a Mapping Really Does A memory mapping installs page-table entries lazily, so the first touch of each page faults into the page cache. The fault path, the shared and private cases, and the failure modes that follow from the split between mapping and page tables.
- 09 io_uring: Shared Rings, Submission Entries, and Completion Ordering How a submission queue and a completion queue are mapped into the process, what the two barriers protect, and why a batched interface changes the cost of a system call.
- 10 pidfd: A Process Handle That Cannot Be Reused A process id is recycled the moment a process is reaped, so any operation addressed by pid can hit an unrelated process. A pidfd refers to the process object itself and closes the race.