Linux C Programming from Beginner to Mastery cover

Linux C Programming from Beginner to Mastery

No rating yet
Word count
780 words
Chapters
11
ISBN
9787121174155

Tags

Summary

Using Ubuntu 11.04 as its practice platform, this book systematically explains how to program in C within a Linux environment. Through numerous directly runnable program examples, it helps readers start from zero and master C development on Linux, gradually acquiring the ability to develop larger applications. The book covers Linux basics and common commands; setting up the C development environment under Linux and its compilation and debugging toolchain (the gcc compiler, make/Makefile project management, autoconf/automake automated builds, gdb debugging, and integrated development environments); system calls for file and directory operations in C; the use of standard I/O library functions; and concurrency topics such as the concept of processes, process creation and control, interprocess communication, and thread creation and synchronization. In the advanced section it further introduces socket-based network programming, methods for accessing databases from C, and practical GTK+/GNOME graphical interface programming. The book is organized from easy to advanced: it first tackles "installing the system and running your first Linux C program," then explains compilation and project management, and then goes layer by layer into system calls, processes and threads, networking, and interface development, forming a progressive learning path from basic operations to comprehensive applications. The code examples are accompanied by explanations, and the book includes a DVD with the example source code and other companion resources (the disc may require an external optical drive or an older system to read on current devices). Because the book uses Ubuntu 11.04 and its toolchain and examples date from an earlier era, some interface and command details differ from current mainstream distributions, but core knowledge such as Linux system calls, the process and thread model, and socket programming remains generally applicable.

Editor's review

这本书的定位很清楚:面向“想在 Linux 下写 C”的初学者,把最容易把人卡住的环节(装环境、跑通第一个程序、看懂编译报错、工程怎么组织)都放到了前面解决,而不是一上来就堆系统调用。 它比较难得的几点:一是工具链讲得成体系,gcc、make/Makefile、autoconf/automake、gdb 一路串下来,读者学完能按真实项目的方式组织代码;二是从文件目录操作、标准 I/O 一直递进到进程、进程间通信、线程、套接字网络编程和数据库访问,脉络清晰,适合当作“第一本系统编程书”通读;三是示例密度高,配套光盘给了源码,动手照着敲的收益远大于只看。 需要提醒的是,书中以 Ubuntu 11.04 为平台,部分命令行输出、界面与软件包版本已与现在的发行版不同,GUI 部分(GTK+)的代码也可能需要调整才能编译通过。把它当作概念与调用模型的讲解书、用新版系统做实验,效果最好。

Who it's for

A good fit for

  • 已经会一点 C 语言、想从 Windows 转到 Linux 下开发的初学者
  • 计算机、电子类专业学生,需要一本能配合课程实验的 Linux C 教材
  • 做嵌入式开发的入门者,想搞清楚进程、线程与文件 I/O 的实际用法
  • 希望把 gcc、Makefile、gdb 这套工具链真正用起来的自学者

Not a good fit for

  • 完全没有 C 语言基础、需要先补语法与指针的读者
  • 只想研究 Linux 内核源码与内核模块开发的进阶读者
  • 寻找最新发行版与现代工具(如 CMake、clang、容器化开发)内容的读者

Reading tips

  1. 每章照着书中的命令与示例实际敲一遍,遇到报错先自己查 man 手册与 gcc 错误信息。
  2. 读第2章时把 make/Makefile 写熟,先弄明白工程组织,再进入系统调用部分。
  3. 书中 Ubuntu 11.04 的示例建议在新版发行版上重做,命令差异可作为一次很好的排错练习。
  4. 进程、线程、套接字三章建议配合小的动手项目(如简易聊天程序)串联复习。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. Chapter 1 Linux Basics (Introduction to Linux and Its Distributions; Installing a Virtual Machine and Ubuntu; Common Commands: shell, file operations, directory operations, archiving and compression, online help, user operations, shutdown and restart)
  2. Chapter 2 The C Programming Environment on Linux (Development Workflow; Installing and Using gcc; make and Makefile; autoconf; automake)
  3. Chapter 3 System Calls for File and Directory Operations on Linux
  4. Chapter 4 Using Standard I/O Library Functions
  5. Chapter 5 Process Concepts and Process Operations
  6. Chapter 6 Interprocess Communication
  7. Chapter 7 Thread Operations and Multithreaded Programming
  8. Chapter 8 Socket-Based Network Programming
  9. Chapter 9 Database Programming in C
  10. Chapter 10 GTK+/GNOME Graphical Interface Programming
  11. Chapter 11 Integrated Development Environments and a Comprehensive Development Example

FAQ

这本书适用于现在的 Linux 发行版吗?
核心内容(系统调用、进程线程、套接字)完全通用,但书中以 Ubuntu 11.04 为例,安装步骤、界面与部分软件包版本已过时。建议在新版 Ubuntu 或其它发行版上做实验,遇到差异以 man 手册和官方文档为准。
零基础可以直接读吗?
不太建议。书中假定读者已掌握 C 语言基本语法与指针、结构体等内容,重点放在 Linux 平台的开发工具链与系统接口上。完全没有 C 基础的读者最好先用一本 C 语言入门书打过底子。
这本和“Linux C从入门到精通”是同一本书吗?
不是。明日科技著、清华大学出版社出版的《Linux C从入门到精通》是另一本同系列命名的书;本书为刘学勇著、电子工业出版社出版,ISBN 为 9787121174155,切勿混淆。
随书光盘丢了还能学吗?
可以。书中的示例代码基本都在正文里完整给出,照着录入即可;光盘主要是源码与配套资源的便利性补充,不影响主线学习。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category