Linux System Programming - Robert Love

Linux System Programming

Robert Love

出版时间

2013-06-08

ISBN

9781449339531

评分

★★★★★
书籍介绍
Write software that makes the most effective use of the Linux system, including the kernel and core system libraries. The majority of both Unix and Linux code is still written at the system level, and this book helps you focus on everything above the kernel, where applications such as Apache, bash, cp, vim, Emacs, gcc, gdb, glibc, ls, mv, and X exist. Written primarily for engineers looking to program at the low level, this updated edition of Linux System Programming gives you an understanding of core internals that makes for better code, no matter where it appears in the stack. You'll take an in-depth look at Linux from both a theoretical and an applied perspective over a wide range of programming topics, including: An overview of Linux, the kernel, the C library, and the C compiler Reading from and writing to files, along with other basic file I/O operations, including how the Linux kernel implements and manages file I/O Buffer size management, including the Standard I/O library Advanced I/O interfaces, memory mappings, and optimization techniques The family of system calls for basic process management Advanced process management, including real-time processes File and directories-creating, moving, copying, deleting, and managing them Memory management - interfaces for allocating memory, managing the memory you have, and optimizing your memory access Signals and their role on a Unix system, plus basic and advanced signal interfaces Time, sleeping, and clock management, starting with the basics and continuing through POSIX clocks and high resolution timers
精彩摘录
  • "进程(process)是执行中的目标码(object code):正在运行的程序。但它不仅仅是目标码,进程由数据、资源、状态以及一个虚拟的计算机组成。"
  • "Linux 中的授权机制由用户(user)和组(group)提供。每个用户都会被分配一个独一无二的正整数,称为用户标识符(user ID,简称 uid)。每个进程恰好会被关联到一个 uid,用来识别运行进程的用户,这被称为进程的真实用户标识符(real uid)。"
  • "信号(signal)是一种单向一部通知机制。信号可以从内核送往一个进程,从一个进程送往另一个进程,或者从一个进程送给它自己。"
  • "一个文件必须先打开,才可以对它进行操作。内核会替每个进程维护一份已打开文件列表,称为文件表(file table)。此表是通过非负整数被索引,而此非负整数称为文件描述符(file descriptor,缩写 fd)。"
  • "默认情况下,子进程会取得其父进程的文件表。"
  • "该表(file table)中每个条目内含与已打开文件相关的信息,包括一个指针(指向文件 inode 在内存中的副本)以及相关的元数据(例如文件位置与访问模式)。"
  • "第一个文件系统会被挂载到命名空间的 root 结点,“/”,这被称为根文件系统(root file system)。Linux 系统通常会具有一个根文件系统。"
用户评论
一本极好的书
多少有一些感觉 后半部分写的太简单了
native is not naive!兼顾system programming和kernel implementation,对io和thread和memory的讲解尤为精彩。
值得推荐,短小实用,虽然有些部分有参考手册的味道,尤其IO的部分讲解得很详细,适合读APUE前的入门,不过缺少了进程间通信,多线程也讲得太少,最后还是要去读APUE的。
针对Linux3.x内核哦
不是大全
a must read to understand what Linux provides at the system call and libc layer
和作者的LKD一起阅读,效果更佳
结合kernel和glibc 一起讲, 作者功力深厚. 非常值得学习. 个人认为比APUE好.
收藏