Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Michael Kerrisk

Rating No ratings yet

The Linux Programming Interface is the definitive guide to the Linux and UNIX programming interface—the interface employed by nearly every application that runs on a Linux or UNIX system. In this authoritative work, Linux programming expert Michael Kerrisk provides detailed descriptions of the system calls and library functions that you need in order to master the craft of system programming, and accompanies his explanations with clear, complete example programs. You'll find descriptions of over 500 system calls and library functions, and more than 200 example programs, 88 tables, and 115 diagrams. You'll learn how to: • Read and write files efficiently • Use signals, clocks, and timers • Create processes and execute programs • Write secure programs • Write multithreaded programs using POSIX threads • Build and use shared libraries • Perform interprocess communication using pipes, message queues, shared memory, and semaphores • Write network applications with the sockets API While The Linux Programming Interface covers a wealth of Linux-specific features, including epoll, inotify, and the /proc file system, its emphasis on UNIX standards (POSIX.1-2001/SUSv3 and POSIX.1-2008/SUSv4) makes it equally valuable to programmers working on other UNIX platforms. The Linux Programming Interface is the most comprehensive single-volume work on the Linux and UNIX programming interface, and a book that's destined to become a new classic.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A comprehensive, standards-aware handbook for anyone who needs to write or debug low-level Linux/UNIX software, from students meeting system calls for the first time to experienced engineers who want a single authoritative reference beside the machine. 【Book Arc】 - **Opening (~0%–10%)**: Frames the book’s scope and credibility—system calls, library functions, POSIX/SUS standards, and the promise of worked examples—so readers know this is a reference-plus-tutorial, not a kernel-internals text. - **Early (~10%–30%)**: Builds the foundation: UNIX/C history, fundamental concepts, system-programming mechanics (errors, portability, feature-test macros), then file I/O, processes, memory allocation, users/groups, time, limits, and file-system basics. - **Middle (~30%–55%)**: Moves into process control and richer I/O: signals from fundamentals through advanced handlers, timers, process creation/execution, threads, file attributes, directories/links, and file-event monitoring. - **Late (~55%–80%)**: Covers the machinery of larger systems: shared libraries, IPC overview, System V and POSIX IPC (message queues, semaphores, shared memory), memory mappings, virtual-memory operations, and file locking. - **Ending (~80%–100%)**: Applies the API to network and terminal programming: sockets from UNIX domain through TCP/IP and server design, advanced socket topics, terminals, alternative I/O models, pseudoterminals, plus appendices on tracing, option parsing, NULL casting, kernel configuration, and further sources. 【Key Takeaways】 - **The book is organized as a progressive system-programming curriculum, not a random API dump** (Early): it starts with concepts and portability, then layers file I/O, processes, signals, threads, IPC, and sockets so each topic rests on earlier material. - **Standards awareness is a first-class concern** (Early): POSIX.1-2001/SUSv3 and POSIX.1-2008/SUSv4 are treated as the baseline, which is why the material transfers to other UNIX platforms even when Linux-specific features are discussed. - **File I/O is taught as a universal model with important edge cases** (Middle): the basics expand into duplicated descriptors, positioned and scatter-gather I/O, truncation, nonblocking I/O, large files, `/dev/fd`, and temporary files. - **Processes, memory, and credentials are inseparable from real system behavior** (Middle): process layout, `brk`/`sbrk`, `malloc`/`free`, stack allocation, password/shadow files, and process credentials all shape how programs actually run. - **Signals and timers require careful, staged understanding** (Middle): the book separates fundamental concepts, handler design, and advanced features, which is exactly where many production bugs hide. - **IPC is presented as a family of trade-offs** (Late): pipes/FIFOs, System V IPC, POSIX IPC, memory mappings, and file locking are compared through use cases rather than presented as isolated APIs. - **Sockets and server design are the applied culmination** (Ending): UNIX-domain and Internet sockets, TCP/IP fundamentals, server design, advanced socket topics, and alternative I/O models connect the API to networked services. - **The book is designed for hands-on use** (Early): example programs, exercises, tables, and diagrams are integral, and appendices support tracing system calls, parsing options, and finding further information. 【Reading Tips】 - **Read the early conceptual chapters properly** (history, fundamental concepts, system-programming concepts, portability): they are short relative to the whole book but prevent confusion later. - **Deep-read the file I/O, process, signal, and IPC chapters** if you write production systems code; these are the highest-leverage areas and the ones most often misunderstood. - **Use the later socket and server-design chapters as a project companion**: build a small client/server or IPC tool while reading rather than trying to memorize APIs. - **Skim Linux-specific corners on a first pass** (for example `/proc`, `epoll`, `inotify`, pseudoterminals) and return when a real problem requires them. - **Treat exercises and appendices as part of the text**: they turn a reference into a working course and help you verify assumptions about system-call behavior. 【Coverage Limits】 This guide is synthesized from the book’s front matter, praise, brief contents, and selected early/middle excerpts; the excerpts do not cover the full detail of every chapter, so specific examples, exercises, and later chapter contents are summarized at the structural level rather than reproduced.
Page 1
early every application that runs on a Linux or UNIX system. In this authoritative work, Linux programming expert Michael Kerrisk provides detailed descripti...
View in text
Page 9
............................................................ 139 Chapter 8: Users and Groups....................................................................
View in text
Page 13
UNIX and C ........................................................................................2 1.2 A Brief History of Linux ..............................
View in text
Page 9
6.5 The Stack and Stack Frames ....................................................................................... 121 6.6 Command-Line Arguments (argc,...
View in text
Page 16
........ 237 13.3 Controlling Kernel Buffering of File I/O........................................................................ 239 13.4 Summary of I/O Bu...
View in text
Page 18
................ 378 19.4 Reading inotify Events................................................................................................ 379 19.5 Que...
View in text
Page 19
settime() ........................................ 498 23.6.3 Retrieving the Current Value of a Timer: timer_gettime() ............................. 499 23.6...
View in text
Page 20
.................................................... 624 29.6 Joining with a Terminated Thread..................................................................
View in text
Tags
AI categories
LinuxProgramming LanguageBackend
ISBN: 159327291X
Publisher: No Starch Press
Publish Year: 2010
Language: English
Pages: 1556
File Format: PDF
File Size: 6.9 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…