TL;DR: 3/5. An okay Operating Systems theory refresher. A couple of solid chapters, in a marasm of long pastings, verbose writing and bad editing.

I’ve recently finished a book named Hands-on System Programming with Linux. I initially picked this book as I was looking for an “updated and Linux-specific APUE 3rd” as I wanted both to refresh on various system-level programming on Linux topics and discover any recent tricks, API’s, changes etc,. that I wasn’t aware of.
Below are quick outlines of the book’s 19 chapters.
Chapter 1: Linux System Architecture
- Too many pages wasted talking about Unix philosophy and cli tools. Basic knowledge that should be expected from readers of this book.
- Good explanation of CPU’s ABI and registers, the kernel mode vs user mode.
- Lacking explanation of process context vs interrupt context.
Chapter 2: Virtual Memory
- A bit too verbose again, but I did like the gradual explanation of different VM concepts with detailed diagrams about virtual address space layout on Linux, the different segments and the vm split.
Chapter 3: Resource Limits
- A short discussion of process limits, their granularity and soft vs hard limits.
- Very few “hands-on programming” if any, after 3 chapters so far.
Chapter 4: Dynamic Memory Allocation
- Discussion of malloc()’s API family, how they are internally implemented, differences with alloca().
- Various other memory related API’s (mincore(), mlock()…)
- Other features such demand-paging, mpkeys and LSM logs.
- From here on, the chapters contain too many long code and stdout outputs pastings, a major readability issue for me.
Chapter 5: Linux Memory Issues
- Basic coverage of various memory issues (buffer overflows, uninitialized memory etc,.) in C/C++ programs.
- The writing is too verbose on top of the large copy/pastings. Could have been easily reduced to a couple pages.
- Memory fragmentation (internal and external) explanation was lacking.
Chapter 6: Debugging Tools for Memory Issues
- Quick chapter about using Valgrind and ASan and mallopt() to detect various memory bugs. Too verbose again.
Chapter 7: Process Credentials
- A lengthy discussion about classic Unix permissions, setuid/setgid bits, saved-setuid etc,.
- Too many useless screenshots.
Chapter 8: Process Capabilities
- As a follow-up, this chapter discusses Linux’ capabilities in relation to classic Unix permissions models.
- A bad explanation of the difference between thread and file capability sets.
- This chapter was quite informative, but still suffered from the same lack of editing as other chapters.
Chapter 9: Process execution
- A short discussion of how a program is converted into a process and the execv() API family.
Chapter 10: Process Creation
- How fork() works, the fork-exec semantics, wait() and other variants, zombie processes etc,.
Chapter 11 & 12: Signaling (2 parts)
- In-depth discussion of signals mechanism in Linux.
- Usage of sigaction(), different signal handling techniques and signal-safety.
- Different signal-related functions (sigaction(), sigwait(), signalfd() etc,.)
- Real-time signals, handling race-conditions related to signals, and getting detailed info from siginfo_t.
- These were good and insightful chapters.
Chapter 13: Timers
- Informative chapter on different timer APIs (alarm(), time_create()…) and their intricacies.
Chapters 14, 15 and 16: Multithreading with Pthreads (3 parts)
- Discussion of the concept of threads, differences with multiprocessing model (design, performance, usage etc,.)
- The essential functions of the pthread() family (creation, termination, joining etc,.)
- Race-conditions, atomicity and locking concepts.
- Usage of pthread mutex and condition variables.
- Making code thread-safe (Via mutex, refactoring, local variables, thread-local-storage…)
- Thread cancellation and cleanup.
Chapter 17: CPU Scheduling on Linux
- A short chapter on process scheduling, types of real-time systems, and Linux’s soft real-time capabilities.
Chapter 18: Advanced File I/O
- A very nice chapter on I/O related performance issues.
- Different techniques used such scatter/gather, memory mapping, direct I/O and asynchronous I/O.
Chapter 19: Troubleshooting and Best Practices
- Quick mention of different Linux diagonostic tools and programming best-practices.