Linux Application Development

by ;
Edition: 2nd
Format: Hardcover
Pub. Date: 2004-11-17
Publisher(s): Addison-Wesley Professional
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $52.49

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

"The first edition of this book has always been kept within arm's reach of my desk due to the wonderful explanations of all areas of the Linux userspace API. This second edition greatly overshadows the first one, and will replace it." --Greg Kroah-Hartman, Linux kernel programmer Develop Software that Leverages the Full Power of Today's Linux Linux Application Development, Second Edition,is the definitive reference for Linux programmers at all levels of experience, including C programmers moving from other operating systems. Building on their widely praised first edition, leading Linux programmers Michael Johnson and Erik Troan systematically present the key APIs and techniques you need to create robust, secure, efficient software or to port existing code to Linux. This book has been fully updated for the Linux 2.6 kernel, GNU C library version 2.3, the latest POSIX standards, and the Single Unix Specification, Issue 6. Its deep coverage of Linux-specific extensions and features helps you take advantage of the full power of contemporary Linux. Along the way, the authors share insights, tips, and tricks for developers working with any recent Linux distribution, and virtually any version of Unix. Topics include Developing in Linux: understanding the operating system, licensing, and documentation The development environment: compilers, linker and loader, and unique debugging tools System programming: process models, file handling, signal processing, directory operations, and job control Terminals, sockets, timers, virtual consoles, and the Linux console Development libraries: string matching, terminal handling, command-line parsing, authentication, and more Hundreds of downloadable code samples New to this edition The GNU C library (glibc), underlying standards, and test macros Writing secure Linux programs, system daemons, and utilities Significantly expanded coverage of memory debugging, including Valgrind and mpr Greatly improved coverage of regular expressions IPv6 networking coverage, including new system library interfaces for using IPv6 and IPv4 interchangeably Coverage of strace, ltrace, real-time signals, poll and epoll system calls, popt library improvements, Pluggable Authentication Modules (PAM), qdbm, and much more Improved index and glossary, plus line-numbered code examples

Author Biography

Erik W. Troan, confounder and Executive VP of Operating Systems at Specifix, was formerly Vice President of Product Engineering at Red Hat.

Table of Contents

List of Tables
Code Examples
Preface
Getting Started
History of Linux Development
A Short History of Free Unix Software.Development of Linux
Notional Lineage of Unix Systems.Linux Lineage
Licenses and Copyright
Copyright
Licensing
Free Software Licenses
Online System Documentation
The man Pages
The Info Pages
Other Documentation
Development Tools and Environment
Development Tools
Editors
Make
The GNU Debugger
Tracing Program Actions
gcc Options and Extensions
gcc Options
Header Files
The GNU C Library
Feature Selection
POSIX Interfaces
Compatibility
Memory Debugging Tools
Buggy Code
Memory-Checking Tools Included in glibc
Finding Memory Leaks with mpr
Investigating Memory Errors with Valgrind
Electric Fence
Creating and Using Libraries
Static Libraries
Shared Libraries
Designing Shared Libraries
Building Shared Libraries
Installing Shared Libraries
Using Shared Libraries
Linux System Environment
The Process Environment
Understanding System Calls
Finding Header and Library Files
System Programming
The Process Model
Defining a Process
Process Attributes
Process Information
Process Primitives
Simple Children
Sessions and Process Groups
Introduction to l a d s h
Creating Clones
Simple File Handling
The File Mode
Basic File Operations
Querying and Changing Inode Information
Manipulating Directory Entries
Manipulating File Descriptors
Creating Unnamed Pipes
Adding Redirection to l a d s h
Signal Processing
Signal Concepts
The Linux (and POSIX) Signal API
Available Signals
Writing Signal Handlers
Reopening Log Files
Real-Time Signals
Learning About a Signal
Advanced File Handling
Input and Output Multiplexing
Memory Mapping
File Locking
Alternatives to read() and write()
Directory Operations
The Current Working Directory
Changing the Root Directory
Creating and Removing Directories
Reading a Directory's Contents
File Name Globbing
Adding Directories and Globbing to ladsh
Walking File System Trees
Directory Change Notification
Job Control
Job Control Basics
Job Control in ladsh
Terminals and Pseudo Terminals
tty Operations
termios Overview
termios Examples
termios Debugging
termios Reference
Pseudo ttys
Networking with Sockets
Protocol Support
Utility Functions
Basic Socket Operations
Unix Domain Sockets
Networking Machines with TCP/IP
Using UDP Datagrams
Socket Errors
Legacy Networking Functions
Time
Telling Time and Dates
Using Timers
Random Numbers
Pseudo-Random Numbers
Cryptography and Random Numbers
Programming Virtual Consoles
Getting Started
Beeping
Determining Whether the Terminal Is a VC
Finding the Current VC
Managing VC Switching
Example: The open Command
The Linux Console
Capability Databases
Glyphs, Characters, and Maps
Linux Console Capabilities
Direct Screen Writing
Writing Secure Programs
When Security Matters
Minimizing the Opportunity for Attack
Common Security Holes
Running as a Daemon
IV
String Matching
Globbing Arbitrary Strings
Regular Expressions
Terminal Handling with S-Lang
Input Handling
Output Handling
A Hashed Database Library
Overview
Basic Operations
Reading Records
Modifying the Database
Example
Parsing Command-Line Options
The Option Table
Using the Option Table
Using Callbacks
Error Handling
Option Aliasing
Parsing Argument Strings
Handling Extra Arguments
Sample Application
Dynamic Loading at Run Time
The dl Interface
User Identification and Authentication
ID-to-Name Translation
Pluggable Authentication Modules
Appendices
Header Files
ladsh Source Code
Glossary
Bibliography
Index
Table of Contents provided by Publisher. All Rights Reserved.

Excerpts

We wrote this book for experienced (or not-so-experienced, but eager-to-learn) programmers who want to develop Linux software or to port software from other platforms to Linux. This is the book we wish we had when we were learning to program for Linux, and the book we now keep on our desks for reference. As soon as we wrote the first three chapters of the first edition, we were using the drafts as reference material while we worked.This second edition removes outdated information, adds new information, and introduces an online version. You can now browse and search the entire content of this book at http://ladweb.net/ to make this book even more useful to you.Linux is designed to be similar to Unix. This book gives you a good background in Unix programming basics and style. Linux is not fundamentally different from Unix; it differs in some details, but no more than one Unix version typically differs from another Unix version. This book is very much a Unix programming guide that is written from a Linux viewpoint and with specific Linux information.Linux also has unique extensions, such as its direct screen access capabilities (see Chapter 21), and it has features that are used more often on it than on other systems, such as the popt library (see Chapter 26). This book covers many of those extensions and features so that you can write programs that truly take advantage of Linux. If you are a C programmer, but you know neither Unix nor Linux, reading this book cover-to-cover and working with the examples should put you well on the road to being a competent Linux programmer. With the aid of system-specific documentation, you should find the transition to any version of Unix easy. If you are already a proficient Unix programmer, you will find that this book makes your transition to Linux easier. We have tried very hard to make it easy for you to find precisely the information you need to know. We also carefully and clearly cover topics that sometimes trip up even experienced Unix programmers, such as process and session groups, job control, and tty handling. If you are already a Linux programmer, this book covers confusing topics clearly and will make many of your programming tasks easier. Nearly every chapter will stand alone for you, because you already possess the essential knowledge of Linux on which they are based. No matter how experienced you are, you will find material here that you will appreciate having at your elbow.This book is different from typical Unix programming texts because it is unabashedly specific to a particular operating system. We do not try to cover all the differences between different Unix-like systems; to do so would not be useful to Linux programmers, Unix programmers, or C programmers unfamiliar with Linux or Unix. We know from our own experience that once you learn how to program well for any Unix-like system, the others are easy to learn.This book does not coverallthe details of Linux programming. It does not explain the basic interface specified by ANSI/ISO C---other books do that quite well. It does not cover the wealth of other programming languages available for Linux, and it does not cover the graphical programming libraries that are identical no matter what system you are using. Instead, we point you to books that specialize in those areas. Without extraordinary verbosity, we cover the information you need to know to go from being a C programmer for another system, such as Windows, Macintosh, or even DOS, to being a C programmer for Linux.Linux Application Developmentis written in four parts: The first part introduces you to Linux---the operating system, license terms, and online system documentation. The second part covers the most important facets of the development environment---the compilers, linker and loader, and some debugging to

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.