Linux Application Development (paperback)

by ;
Edition: 2nd
Format: Paperback
Pub. Date: 2005-01-01
Publisher(s): Addison-Wesley Professional
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $57.74

Rent Book

Select for Price
There was a problem. Please try again later.

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

eBook

We're Sorry
Not Available

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

This practical reference guides students and practicing programmers who need to develop Linux applications or port applications from other platforms. Linux is fundamentally similar to UNIX, so much of the book covers ground familiar to UNIX programmers; but the book consistently addresses topics from a Linux point of view. The aim throughout is to present such detailed information on the Linux operating system-especially, on the development environment, and on the interface both to the kernel and to the core system libraries-as is required to take full advantage of Linux. If you are already a proficient UNIX programmer, the book will greatly facilitate your transition to Linux. If you can program in C, but know neither UNIX nor Linux, reading this book in its entirety and working with its numerous examples will give you a solid introduction to Linux programming. Finally, if you are already a Linux programmer, the book's clear treatment of advanced and confusing topics will surely make your programming tasks easier.

Table of Contents

Preface vii(6)
Contents xiii(10)
List of Tables
xxiii
Part 1 Getting Started 1(28)
Chapter 1 History of Linux Development
3(8)
1.1 A Short History of Free Unix Software
4(2)
1.2 Development of Linux
6(2)
1.3 Basic Lineage of Unix Systems
8(1)
1.4 Linux Lineage
9(2)
Chapter 2 Licenses and Copyright
11(8)
2.1 Copyright
11(2)
2.2 Licensing
13(1)
2.3 Free Software Licenses
14(5)
2.3.1 Combinations of Free and Commercial Software
14(1)
2.3.2 The GNU General Public License
15(1)
2.3.3 The GNU Library General Public License
15(1)
2.3.4 MIT/X-Style Licenses
16(1)
2.3.5 BSD-Style Licenses
16(1)
2.3.6 Artistic License
16(1)
2.3.7 License Incompatibilities
17(2)
Chapter 3 More Information on Linux
19(10)
3.1 Overview of Linux Documentation
19(4)
3.1.1 The HOWTOs and mini-HOWTOs
21(1)
3.1.2 The LDP Books
21(1)
3.1.3 The Linux Software Map
21(1)
3.1.4 The man Pages
21(2)
3.2 Other Books
23(1)
3.3 Source Code
23(1)
3.4 Linux (and Other) Newsgroups
23(2)
3.5 Mailing Lists
25(2)
3.5.1 vger
26(1)
3.5.2 Other Lists
26(1)
3.6 Other Documentation
27(1)
3.6.1 GNU
27(1)
3.6.2 BSD
27(1)
3.7 Your Distribution Vendor
28(1)
Part 2 Development Tools and Environment 29(62)
Chapter 4 Development Tools
31(16)
4.1 Editors
31(3)
4.1.1 Emacs
33(1)
4.1.2 vi
33(1)
4.2 Make
34(6)
4.2.1 Complex Command Lines
37(1)
4.2.2 Variables
38(1)
4.2.3 Suffix Rules
39(1)
4.3 The GNU Debugger
40(7)
Chapter 5 gcc Options and Extensions
47(6)
5.1 gcc Options
48(2)
5.2 Header Files
50(3)
5.2.1 long long
51(1)
5.2.2 Inline Functions
51(1)
5.2.3 Alternative Extended Keywords
51(1)
5.2.4 Attributes
51(2)
Chapter 6 Memory Debugging Tools
53(14)
6.1 Buggy Code
53(2)
6.2 Electric Fence
55(5)
6.2.1 Using Electric Fence
56(1)
6.2.2 Memory Alignment
57(1)
6.2.3 Other Features
58(1)
6.2.4 Limitations
59(1)
6.2.5 Resource Consumption
59(1)
6.3 Checker
60(2)
6.3.1 Finding Overruns
60(1)
6.3.2 Finding Memory Leaks
61(1)
6.4 mpr and mcheck ()
62(5)
6.4.1 Finding Memory Corruption with mcheck
62(1)
6.4.2 Finding Memory Leaks with mpr
63(4)
Chapter 7 Creating and Using Libraries
67(12)
7.1 Static Libraries
67(1)
7.2 Shared Libraries
68(1)
7.3 Designing Shared Libraries
69(3)
7.3.1 Managing Compatibility
70(1)
7.3.2 Incompatible Libraries
71(1)
7.3.3 Designing Compatible Libraries
71(1)
7.4 Building Shared Libraries
72(1)
7.5 Installing Shared Libraries
73(3)
7.5.1 Example
74(2)
7.6 Using Shared Libraries
76(3)
7.6.1 Using Noninstalled Libraries
76(1)
7.6.2 Preloading Libraries
77(2)
Chapter 8 Linux Development Environment
79(12)
8.1 Understanding System Calls
79(10)
8.1.1 System Call Limitations
80(1)
8.1.2 System Call Return Codes
81(2)
8.1.3 Using System Calls
83(1)
8.1.4 Common Error Return Codes
84(5)
8.2 Finding Header and Library Files
89(2)
Part 3 System Programming 91(314)
Chapter 9 The Process Model
93(48)
9.1 Defining a Process
93(2)
9.1.1 Complicating Things with Threads
94(1)
9.1.2 The Linux Approach
94(1)
9.2 Process Attributes
95(8)
9.2.1 The pid and Parentage
95(1)
9.2.2 Credentials
96(4)
9.2.3 The fsuid
100(1)
9.2.4 User and Group ID Summary
101(2)
9.3 Process Information
103(6)
9.3.1 Program Arguments
103(2)
9.3.2 Resource Usage
105(2)
9.3.3 Establishing Usage Limits
107(2)
9.4 Process Primitives
109(9)
9.4.1 Having Children
109(1)
9.4.2 Watching Your Children Die
110(2)
9.4.3 Running New Programs
112(3)
9.4.4 A Bit of History: vfork()
115(1)
9.4.5 Killing Yourself
115(1)
9.4.6 Killing Others
116(1)
9.4.7 Dumping Core
117(1)
9.5 Simple Children
118(3)
9.5.1 Running and Waiting with system()
118(1)
9.5.2 Reading or Writing from a Process
119(2)
9.6 Sessions and Process Groups
121(4)
9.6.1 Sessions
122(1)
9.6.2 Controlling Terminal
123(1)
9.6.3 Process Groups
123(2)
9.7 Introduction to ladsh
125(13)
9.7.1 Running External Programs with ladsh
125(13)
9.8 Creating Clones
138(3)
Chapter 10 Simple File Handling
141(46)
10.1 The File Mode
144(7)
10.1.1 File Access Permissions
145(1)
10.1.2 File Permission Modifiers
146(2)
10.1.3 File Types
148(1)
10.1.4 The Process's umask
149(2)
10.2 Basic File Operations
151(11)
10.2.1 File Descriptors
151(1)
10.2.2 Closing Files
152(1)
10.2.3 Opening Files in the File System
152(2)
10.2.4 Reading, Writing, and Moving Around
154(5)
10.2.5 Partial Reads and Writes
159(2)
10.2.6 Shortening Files
161(1)
10.2.7 Other Operations
161(1)
10.3 Querying and Changing Inode Information
162(11)
10.3.1 Finding Inode Information
162(1)
10.3.2 A Simple Example of stat()
163(3)
10.3.3 Easily Determining Access Rights
166(1)
10.3.4 Changing a File's Access Permissions
167(1)
10.3.5 Changing a File's Owner and Group
167(1)
10.3.6 Changing a File's Timestamps
168(1)
10.3.7 Ext2 Extended Attributes
169(4)
10.4 Manipulating Directory Entries
173(6)
10.4.1 Creating Device and Named Pipe Entries
173(3)
10.4.2 Creating Hard Links
176(1)
10.4.3 Using Symbolic Links
177(1)
10.4.4 Removing Files
178(1)
10.4.5 Renaming Files
179(1)
10.5 Manipulating File Descriptors
179(3)
10.5.1 Changing the Access Mode for an Open File
180(1)
10.5.2 Modifying the close-on-exec Flag
180(1)
10.5.3 Duplicating File Descriptors
181(1)
10.6 Creating Unnamed Pipes
182(1)
10.7 Adding Redirection to ladsh
183(4)
10.7.1 The Data Structures
183(1)
10.7.2 Changing the Code
184(3)
Chapter 11 Directory Operations
187(18)
11.1 The Current Working Directory
187(3)
11.1.1 Finding the Current Working Directory
187(2)
11.1.2 The . and .. Special Files
189(1)
11.1.3 Changing the Current Directory
189(1)
11.2 Changing the Root Directory
190(1)
11.3 Creating and Removing Directories
190(1)
11.3.1 Creating New Directories
190(1)
11.3.2 Removing Directories
191(1)
11.4 Reading a Directory's Contents
191(2)
11.4.1 Starting Over
193(1)
11.5 File Name Globbing
193(6)
11.5.1 Use a Subprocess
194(1)
11.5.2 Internal Globbing
195(4)
11.6 Adding Directories and Globbing to ladsh
199(6)
11.6.1 Adding cd and pwd
199(1)
11.6.2 Adding File Name Globbing
200(5)
Chapter 12 Advanced File Handling
205(30)
12.1 Input and Output Multiplexing
205(10)
12.1.1 Nonblocking I/O
208(1)
12.1.2 Multiplexing with select()
209(6)
12.2 Memory Mapping
215(8)
12.2.1 Page Alignment
216(1)
12.2.2 Establishing Memory Mappings
216(5)
12.2.3 Unmapping Regions
221(1)
12.2.4 Syncing Memory Regions to Disk
221(1)
12.2.5 Locking Memory Regions
222(1)
12.3 File Locking
223(9)
12.3.1 Lock Files
224(2)
12.3.2 Record Locking
226(6)
12.3.3 Mandatory Locks
232(1)
12.4 Scatter/Gather Reads and Writes
232(3)
Chapter 13 Signal Processing
235(22)
13.1 Signal Concepts
236(4)
13.1.1 Simple Signals
236(2)
13.1.2 POSIX Signals
238(1)
13.1.3 Signals and System Calls
239(1)
13.2 The Linux (and POSIX) Signal API
240(7)
13.2.1 Sending Signals
240(1)
13.2.2 Using sigset_t
241(1)
13.2.3 Catching Signals
242(2)
13.2.4 Manipulating a Process's Signal Mask
244(2)
13.2.5 Finding the Set of Pending Signals
246(1)
13.2.6 Waiting for Signals
246(1)
13.3 Available Signals
247(5)
13.4 Writing Signal Handlers
252(1)
13.5 Reopening Log Files
253(4)
Chapter 14 Job Control
257(10)
14.1 Job Control Basics
257(3)
14.1.1 Restarting Processes
257(1)
14.1.2 Stopping Processes
258(1)
14.1.3 Handling Job Control Signals
259(1)
14.2 Job Control in ladsh
260(7)
Chapter 15 Terminals and Pseudo Terminals
267(52)
15.1 tty Operations
268(2)
15.1.1 Controlling Terminals
269(1)
15.2 termios Overview
270(2)
15.3 termios Examples
272(17)
15.3.1 Passwords
272(2)
15.3.2 Serial Communications
274(15)
15.4 termios Debugging
289(1)
15.5 termios Reference
290(18)
15.5.1 Functions
291(4)
15.5.2 Window Sizes
295(1)
15.5.3 Flags
296(1)
15.5.4 Input Flags
297(2)
15.5.5 Output Flags
299(1)
15.5.6 Control Flags
300(2)
15.5.7 Control Characters
302(3)
15.5.8 Local Flags
305(2)
15.5.9 Controlling read()
307(1)
15.6 Pseudo ttys
308(11)
15.6.1 Opening Pseudo ttys
309(3)
15.6.2 Pseudo tty Example
312(7)
Chapter 16 Networking with Sockets
319(38)
16.1 Protocol Support
319(4)
16.1.1 Nice Networking
320(1)
16.1.2 Real Networking
321(1)
16.1.3 Making Reality Play Nice
321(2)
16.1.4 Addresses
323(1)
16.2 Utility Functions
323(1)
16.3 Basic Socket Operations
324(5)
16.3.1 Creating a Socket
324(2)
16.3.2 Establishing Connections
326(1)
16.3.3 Binding an Address to a Socket
326(1)
16.3.4 Waiting for Connections
326(2)
16.3.5 Connecting to a Server
328(1)
16.4 Unix Domain Sockets
329(11)
16.4.1 Unix Domain Addresses
329(1)
16.4.2 Waiting for a Connection
330(2)
16.4.3 Connecting to a Server
332(2)
16.4.4 Running the Unix Domain Examples
334(1)
16.4.5 Unnamed Unix Domain Sockets
334(1)
16.4.6 Passing File Descriptors
334(6)
16.5 Networking Machines with TCP/IP
340(15)
16.5.1 Byte Ordering
340(2)
16.5.2 IPv4 Addressing
342(1)
16.5.3 IP Socket Addresses
342(1)
16.5.4 Manipulating IP Addresses
343(1)
16.5.5 Using Hostnames
344(2)
16.5.6 Host Information Lookup Example
346(2)
16.5.7 Looking Up Port Numbers
348(3)
16.5.8 Listening for TCP Connections
351(2)
16.5.9 TCP Client Applications
353(2)
16.6 Socket Errors
355(2)
Chapter 17 Time
357(14)
17.1 Telling Time and Dates
357(9)
17.1.1 Representing Time
357(3)
17.1.2 Converting, Formatting, and Parsing Times
360(5)
17.1.3 The Limits of Time
365(1)
17.2 Using Timers
366(5)
17.2.1 Sleeping
367(1)
17.2.2 Interval Timers
368(3)
Chapter 18 Random Numbers
371(4)
18.1 Pseudo-Random Numbers
371(1)
18.2 Cryptography and Random Numbers
372(3)
Chapter 19 Programming Virtual Consoles
375(12)
19.1 Getting Started
376(3)
19.2 Beeping
379(1)
19.3 Determining Whether the Terminal Is a VC
380(1)
19.4 Finding the Current VC
380(1)
19.5 Managing VC Switching
380(4)
19.6 Example: The open Command
384(3)
Chapter 20 The Linux Console
387(18)
20.1 Capability Databases
388(2)
20.2 Glyphs, Characters, and Maps
390(1)
20.3 Linux Console Capabilities
391(11)
20.3.1 Control Characters
392(2)
20.3.2 Escape Sequences
394(1)
20.3.3 Testing Sequences
395(1)
20.3.4 Complex Escape Sequences
396(6)
20.4 Direct Screen Writing
402(3)
Part 4 Development Libraries 405(68)
Chapter 21 String Matching
407(8)
21.1 Globbing Arbitrary Strings
407(1)
21.2 Regular Expressions
408(7)
Chapter 22 Terminal Handling with S-Lang
415(14)
22.1 Input Handling
416(3)
22.1.1 Initializing S-Lang Input Handling
417(1)
22.1.2 Restoring the Terminal State
417(1)
22.1.3 Reading Characters from the Terminal
418(1)
22.1.4 Checking for Input with SLang_input_pending()
418(1)
22.2 Output Handling
419(10)
22.2.1 Initializing Screen Management
420(1)
22.2.2 Updating the Display
420(1)
22.2.3 Moving the Cursor
421(1)
22.2.4 Finishing Screen Management
421(1)
22.2.5 Skeleton Screen Management
421(1)
22.2.6 Switching Character Sets
422(1)
22.2.7 Writing to the Screen
423(2)
22.2.8 Drawing Lines and Boxes
425(2)
22.2.9 Using Color
427(2)
Chapter 23 The Database Library
429(16)
23.1 Overview
429(2)
23.2 Basic Operations
431(3)
23.2.1 Opening a db File
431(1)
23.2.2 Closing a Database
432(1)
23.2.3 Obtaining the File Descriptor
433(1)
23.2.4 Syncing the Database
433(1)
23.3 Reading Records
434(1)
23.4 Reading Records Sequentially
434(1)
23.4.1 Reading a Particular Record
435(1)
23.5 Modifying the Database
435(2)
23.5.1 Adding Records
436(1)
23.5.2 Removing Records
436(1)
23.6 Example
437(8)
Chapter 24 Parsing Command-Line Options
445(12)
24.1 Basic popt Usage
446(4)
24.1.1 The Option Table
446(2)
24.1.2 Creating a Context
448(1)
24.1.3 Parsing the Command Line
449(1)
24.1.4 Leftover Arguments
450(1)
24.2 Error Handling
450(2)
24.3 Option Aliasing
452(2)
24.3.1 Specifying Aliases
453(1)
24.3.2 Enabling Aliases
453(1)
24.4 Parsing Argument Strings
454(1)
24.5 Handling Extra Arguments
455(1)
24.6 Sample Application
455(2)
Chapter 25 Dynamic Loading at Run Time
457(6)
25.1 The dl Interface
458(5)
25.1.1 Example
461(2)
Chapter 26 Names and the User Databases
463(10)
26.1 ID-to-Name Translation
463(8)
26.1.1 Example: The id Command
466(5)
26.2 Modifying the System Databases
471(2)
26.2.1 Pluggable Authentication Modules
471(1)
26.2.2 Password Database Library
472(1)
Appendices 473(44)
Appendix A Direct Access to I/O Ports 475(4)
A.1 Almost Portable I/O Port Access 475(2)
A.2 Direct I/O Port Access 477(2)
A.2.1 The Safe Way 477(1)
A.2.2 The Dangerous Way 478(1)
Appendix B ladsh Source Code 479(18)
Appendix C The GNU Licenses 497(20)
C.1 The GNU General Public License 497(9)
C.2 The GNU Library General Public License 506(11)
Glossary 517(4)
Bibliography 521(4)
Index 525

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.