文件名称:Linux System Programming
文件大小:1.96MB
文件格式:PDF
更新时间:2017-05-22 17:44:49
Linux, System, Eng
If any evolving operating system is a moving target, Linux is a rabid cheetah. Progress is measured in days, not years, and frequent releases of the kernel and other components constantly morph the playing field. No book can hope to capture such a dynamic beast in a timeless fashion. Nonetheless, the programming environment defined by system programming is set in stone.... Contents of This Book This book is broken into 10 chapters, an appendix, and a bibliography. Chapter 1, Introduction and Essential Concepts This chapter serves as an introduction, providing an overview of Linux, system programming, the kernel, the C library, and the C compiler. Even advanced users should visit this chapter—trust me. Chapter 2, File I/O This chapter introduces files, the most important abstraction in the Unix environment, and file I/O, the basis of the Linux programming mode. This chapter covers reading from and writing to files, along with other basic file I/O operations. The chapter culminates with a discussion on how the Linux kernel implements and manages files. Chapter 3, Buffered I/O This chapter discusses an issue with the basic file I/O interfaces—buffer size management—and introduces buffered I/O in general, and standard I/O in particular, as solutions. Chapter 4, Advanced File I/O This chapter completes the I/O troika with a treatment on advanced I/O interfaces, memory mappings, and optimization techniques. The chapter is capped with a discussion on avoiding seeks, and the role of the Linux kernel’s I/O scheduler Chapter 5, Process Management This chapter introduces Unix’s second most important abstraction, the process, and the family of system calls for basic process management, including the venerable fork. Chapter 6, Advanced Process Management This chapter continues the treatment with a discussion of advanced process management, including real-time processes. Chapter 7, File and Directory Management This chapter discusses creating, moving, copying, deleting, and otherwise managing files and directories. Chapter 8, Memory Management This chapter covers memory management. It begins by introducing Unix concepts of memory, such as the process address space and the page, and continues with a discussion of the interfaces for obtaining memory from and returning memory to the kernel. The chapter concludes with a treatment on advanced memory-related interfaces. Chapter 9, Signals This chapter covers signals. It begins with a discussion of signals and their role on a Unix system. It then covers signal interfaces, starting with the basic, and concluding with the advanced. Chapter 10, Time This chapter discusses time, sleeping, and clock management. It covers the basic interfaces up through POSIX clocks and high-resolution timers. Appendix, GCC Extensions to the C Language The Appendix reviews many of the optimizations provided by gcc and GNUC, such as attributes for marking a function constant, pure, and inline. The book concludes with a bibliography of recommended reading, listing both useful supplements to this work, and books that address prerequisite topics not covered herein.