Cover image for Advanced Linux programming
Title:
Advanced Linux programming
Author:
Mitchell, Mark, 1972-
Personal Author:
Edition:
First edition.
Publication Information:
Indianapolis, Ind. : New Riders Pub., [2001]

©2001
Physical Description:
xxiii, 340 pages : illustrations ; 23 cm
General Note:
Includes index.
Language:
English
Title Subject:
ISBN:
9780735710436
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Item Holds
Searching...
QA76.76.O63 M585 2001 Adult Non-Fiction Central Closed Stacks
Searching...

On Order

Summary

Summary

An in-depth guide to programming Linux from the most recognized leaders in the Open Source community.


Author Notes

Mark Mitchell received a bachelor of arts degree in computer science from Harvard in 1994 and a master of science degree from Stanford in 1999. His research interests centered on computational complexity and computer security. Mark has participated substantially in the development of the GNU Compiler Collection, and he has a strong interest in developing quality software.

Jeffrey Oldham received a bachelor of arts degree in computer science from Rice University in 1991. After working at the Center for Research on Parallel Computation, he obtained a doctor of philosophy degree from Stanford in 2000. His research interests center on algorithm engineering, concentrating on flow and other combinatorial algorithms. He works on GCC and scientific computing software.

Alex Samuel graduated from Harvard in 1995 with a degree in physics. He worked as a software engineer at BBN before returning to study physics at Caltech and the Stanford Linear Accelerator Center. Alex administers the Software Carpentry project and works on various other projects, such as optimizations in GCC.

Mark and Alex founded CodeSourcery LLC together in 1999. Jeffrey joined the company in 2000. CodeSourcery's mission is to provide development tools for GNU/Linux and other operating systems; to make the GNU tool chain a commercial-quality, standards-conforming development tool set; and to provide general consulting and engineering services. CodeSourcery's Web site is http://www.codesourcery.com.


Table of Contents

I Advanced UNIX Programming with Linuxp. 1
1 Getting Startedp. 3
1.1 Editing with Emacsp. 4
1.2 Compiling with GCCp. 6
1.3 Automating the Process with GNU Makep. 9
1.4 Debugging with GNU Debugger (GDB)p. 11
1.5 Finding More Informationp. 13
2 Writing Good GNU/Linux Softwarep. 17
2.1 Interaction With the Execution Environmentp. 17
2.2 Coding Defensivelyp. 30
2.3 Writing and Using Librariesp. 36
3 Processesp. 45
3.1 Looking at Processesp. 45
3.2 Creating Processesp. 48
3.3 Signalsp. 52
3.4 Process Terminationp. 55
4 Threadsp. 61
4.1 Thread Creationp. 62
4.2 Thread Cancellationp. 69
4.3 Thread-Specific Datap. 72
4.4 Synchronization and Critical Sectionsp. 77
4.5 GNU/Linux Thread Implementationp. 92
4.6 Processes Vs. Threadsp. 94
5 Interprocess Communicationp. 95
5.1 Shared Memoryp. 96
5.2 Processes Semaphoresp. 101
5.3 Mapped Memoryp. 105
5.4 Pipesp. 110
5.5 Socketsp. 116
II Mastering Linuxp. 127
6 Devicesp. 129
6.1 Device Typesp. 130
6.2 Device Numbersp. 130
6.3 Device Entriesp. 131
6.4 Hardware Devicesp. 133
6.5 Special Devicesp. 136
6.6 PTYsp. 142
6.7 ioctlp. 144
7 The /proc File Systemp. 147
7.1 Extracting Information from /procp. 148
7.2 Process Entriesp. 150
7.3 Hardware Informationp. 158
7.4 Kernel Informationp. 160
7.5 Drives, Mounts, and File Systemsp. 161
7.6 System Statisticsp. 165
8 Linux System Callsp. 167
8.1 Using stracep. 168
8.2 access: Testing File Permissionsp. 169
8.3 fcntl: Locks and Other File Operationsp. 171
8.4 fsync and fdatasync: Flushing Disk Buffersp. 173
8.5 getrlimit and setrlimit: Resource Limitsp. 174
8.6 getrusage: Process Statisticsp. 175
8.7 gettimeofday: Wall-Clock Timep. 176
8.8 The mlock Family: Locking Physical Memoryp. 177
8.9 mprotect: Setting Memory Permissionsp. 179
8.10 nanosleep: High-Precision Sleepingp. 181
8.11 readlink: Reading Symbolic Linksp. 182
8.12 sendfile: Fast Data Transfersp. 183
8.13 setitimer: Setting Interval Timersp. 185
8.14 sysinfo: Obtaining System Statisticsp. 186
8.15 unamep. 187
9 Inline Assembly Codep. 189
9.1 When to Use Assembly Codep. 190
9.2 Simple Inline Assemblyp. 191
9.3 Extended Assembly Syntaxp. 192
9.4 Examplep. 194
9.5 Optimization Issuesp. 196
9.6 Maintenance and Portability Issuesp. 196
10 Securityp. 197
10.1 Users and Groupsp. 198
10.2 Process User IDs and Process Group IDsp. 199
10.3 File System Permissionsp. 200
10.4 Real and Effective IDsp. 205
10.5 Authenticating Usersp. 208
10.6 More Security Holesp. 211
11 A Sample GNU/Linux Applicationp. 219
11.1 Overviewp. 219
11.2 Implementationp. 221
11.3 Modulesp. 239
11.4 Using the Serverp. 252
11.5 Finishing Upp. 255
III Appendixesp. 257
A Other Development Toolsp. 259
A.1 Static Program Analysisp. 259
A.2 Finding Dynamic Memory Errorsp. 261
A.3 Profilingp. 269
B Low-Level I/Op. 281
B.1 Reading and Writing Datap. 282
B.2 statp. 291
B.3 Vector Reads and Writesp. 293
B.4 Relation to Standard C Library I/O Functionsp. 295
B.5 Other File Operationsp. 296
B.6 Reading Directory Contentsp. 296
C Table of Signalsp. 301
D Online Resourcesp. 303
D.1 General Informationp. 303
D.2 Information About GNU/Linux Softwarep. 304
D.3 Other Sitesp. 304
E Open Publication License Version 1.0p. 305
I. Requirement on Both Unmodified and Modified Versionsp. 305
II. Copyrightp. 306
III. Scope of Licensep. 306
IV. Requirements on Modified Worksp. 306
V. Good-Practice Recommendationsp. 306
VI. License Optionsp. 307
Open Publication Policy Appendixp. 307
F GNU General Public Licensep. 309
Preamblep. 309
Terms and Conditions for Copying, Distribution and Modificationp. 310
End of Terms and Conditionsp. 315
How to Apply These Terms to Your New Programsp. 315
Indexp. 317