|

Addison-Wesley / Prentice Hall

Computer Science

My Instructor Resource Center :  Log in or request access

Linux Application Development
Michael K. JohnsonRed Hat Software
Erik W. TroanRed Hat Software

ISBN-10: 0201308215
ISBN-13:  9780201308211

Publisher:  Addison-Wesley Professional
Copyright:  1998
Format:  Cloth; 576 pp
Published:  04/20/1998
Status: Out of Print


We're sorry, this product is no longer available.
Please contact your Pearson rep if you are using this product and need instructor resources.

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.



Preface.

I. GETTING STARTED.

History of Linux Development.

A Short History of Free UNIX Software.

Development of Linux.

Basic Lineage of UNIX Systems.

Linux Lineage.

Licenses and Copyright.

Copyright.

Licensing.

Free Software Licenses.

Combinations of Free and Commercial Software.

The GNU General Public License.

The GNU Library General Public License.

MIT/X-Style Licenses.

BSD-Style Licenses.

Artistic License.

License Incompatibilities.

More Information on Linux.

Overview of Linux Documentation.

The HOWTOs and mini-HOWTOs.

The LDP Books.

The Linux Software Map.

The man Pages.

Other Books.

Source Code.

Linux (and Other) Newsgroups.

Mailing Lists.

vger.

Other Lists.

Other Documentation.

GNU.

BSD.

Your Distribution Vendor.

II. DEVELOPMENT TOOLS AND ENVIRONMENT.

Development Tools.

Editors.

Emacs.

vi.

Make.

Complex Command Lines.

Variables.

Suffix Rules.

The GNU Debugger.

gcc Options and Extensions.

gcc Options.

Header Files.

long long.

Inline Functions.

Alternative Extended Keywords.

Attributes.

Memory Debugging Tools.

Buggy Code.

Electric Fence.

Using Electric Fence.

Memory Alignment.

Other Features.

Limitations.

Resource Consumption.

Checker.

Finding Overruns.

Finding Memory Leaks.

mpr and mcheck().

Finding Memory Corruption with mcheck.

Finding Memory Leaks with mpr.

Creating and Using Libraries.

Static Libraries.

Shared Libraries.

Designing Shared Libraries.

Managing Compatibility.

Incompatible Libraries.

Designing Compatible Libraries.

Building Shared Libraries.

Installing Shared Libraries.

Example.

Using Shared Libraries.

Using Noninstalled Libraries.

Preloading Libraries.

Linux Development Environment.

Understanding System Calls.

System Call Limitations.

System Call Return Codes.

Using System Calls.

Common Error Return Codes.

Finding Header and Library Files.

III. System Programming.

The Process Model.

Defining a Process.

Complicating Things with Threads.

The Linux Approach.

Process Attributes.

The pid and Parentage.

Credentials.

The fsuid.

User and Group ID Summary.

Process Information.

Program Arguments.

Resource Usage.

Establishing Usage Limits.

Process Primitives.

Having Children.

Watching Your Children Die.

Running New Programs.

A Bit of History: vfork().

Killing Yourself.

Killing Others.

Dumping Core.

Simple Children.

Running and Waiting with system().

Reading or Writing from a Process.

Sessions and Process Groups.

Sessions.

Controlling Terminal.

Process Groups.

Introduction to ladsh.

Running External Programs with ladsh.

Creating Clones.

Simple File Handling.

The File Mode.

File Access Permissions.

File Permission Modifiers.

File Types.

The Process's umask.

Basic File Operations.

File Descriptors.

Closing Files.

Opening Files in the File System.

Reading, Writing, and Moving Around.

Partial Reads and Writes.

Shortening Files.

Other Operations.

Querying and Changing Inode Information.

Finding Inode Information.

A Simple Example of stat().

Easily Determining Access Rights.

Changing a File's Access Permissions.

Changing a File's Owner and Group.

Changing a File's Timestamps.

Ext2 Extended Attributes.

Manipulating Directory Entries.

Creating Device and Named Pipe Entries.

Creating Hard Links.

Using Symbolic Links.

Removing Files.

Renaming Files.

Manipulating File Descriptors.

Changing the Access Mode for an Open File.

Modifiying the close-on-exec Flag.

Duplicating File Descriptors.

Creating Unnamed Pipes.

Adding Redirection to ladsh.

The Data Structures.

Changing the Code.

Directory Operations.

The Current Working Directory.

Finding the Current Working Directory.

The . and .. Special Files.

Changing the Current Directory.

Changing the Root Directory.

Creating and Removing Directories.

Creating New Directories.

Removing Directories.

Reading a Directory's Contents.

Starting Over.

File Name Globbing.

Use a Subprocess.

Internal Globbing.

Adding Directories and Globbing to ladsh.

Adding cd and pwd.

Adding File Name Globbing.

Advanced File Handling.

Input and Output Multiplexing.

Nonblocking I/O.

Multiplexing with select().

Memory Mapping.

Page Alignment.

Establishing Memory Mappings.

Unmapping Regions.

Syncing Memory Regions to Disk.

Locking Memory Regions.

File Locking.

Lock Files.

Record Locking.

Mandatory Locks.

Scatter/Gather Reads and Writes.

Signal Processing.

Signal Concepts.

Simple Signals.

POSIX Signals.

Signals and System Calls.

The Linux (and POSIX) Signal API.

Sending Signals.

Using sigset_t.

Catching Signals.

Manipulating a Process's Signal Mask.

Finding the Set of Pending Signals.

Waiting for Signals.

Available Signals.

Writing Signal Handlers.

Reopening Log Files.

Job Control.

Job Control Basics.

Restarting Processes.

Stopping Processes.

Handling Job Control Signals.

Job Control in ladsh.

Terminals and Pseudo Terminals.

tty Operations.

Controlling Terminals.

termios Overview.

termios Examples.

Passwords.

Serial Communications.

termios Debugging.

termios Reference.

Functions.

Window Sizes.

Flags.

Input Flags.

Output Flags.

Control Flags.

Control Characters.

Local Flags.

Controlling read().

Pseudo ttys.

Opening Pseudo ttys.

Pseudo tty Example.

Networking with Sockets.

Protocol Support.

Nice Networking.

Real Networking.

Making Reality Play Nice.

Addresses.

Utility Functions.

Basic Socket Operations.

Creating a Socket.

Establishing Connections.

Binding an Address to a Socket.

Waiting for Connections.

Connecting to a Server.

UNIX Domain Sockets.

UNIX Domain Addresses.

Waiting for a Connection.

Connecting to a Server.

Running the UNIX Domain Examples.

Unnamed UNIX Domain Sockets.

Passing File Descriptors.

Networking Machines with TCP/IP.

Byte Ordering.

IPv4 Addressing.

IP Socket Addresses.

Manipulating IP Addresses.

Using Hostnames.

Host Information Lookup Example.

Looking Up Port Numbers.

Listening for TCP Connections.

TCP Client Applications.

Socket Errors.

Time.

Telling Time and Dates.

Representing Time.

Converting, Formatting, and Parsing Times.

The Limits of Time.

Using Timers.

Sleeping.

Interval 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.

Control Characters.

Escape Sequences.

Testing Sequences.

Complex Escape Sequences.

Direct Screen Writing.

IV. DEVELOPMENT LIBRARIES.

String Matching.

Globbing Arbitrary Strings.

Regular Expressions.

Terminal Handling with S-Lang.

Input Handling.

Initializing S-Lang Input Handling.

Restoring the Terminal State.

Reading Characters from the Terminal.

Checking for Input with SLang_input_pending().

Output Handling.

Initializing Screen Management.

Updating the Display.

Moving the Cursor.

Finishing Screen Management.

Skeleton Screen Management.

Switching Character Sets.

Writing to the Screen.

Drawing Lines and Boxes.

Using Color.

The Database Library.

Overview.

Basic Operations.

Opening a db File.

Closing a Database.

Obtaining the File Descriptor.

Syncing the Database.

Reading Records.

Reading Records Sequentially.

Reading a Particular Record.

Modifying the Database.

Adding Records.

Removing Records.

Example.

Parsing Command-Line Options.

Basic popt Usage.

The Option Table.

Creating a Context.

Parsing the Command Line.

Leftover Arguments.

Error Handling.

Option Aliasing.

Specifying Aliases.

Enabling Aliases.

Parsing Argument Strings.

Handling Extra Arguments.

Sample Application.

Dynamic Loading at Run Time.

The dl Interface.

Example.

Names and the User Databases.

ID-to-Name Translation.

Example: The id Command.

Modifying the System Databases.

Pluggable Authentication Modules.

Password Database Library.

Appendices.

Direct Access to I/O Ports.

Almost Portable I/O Port Access.

Direct I/O Port Access.

The Safe Way.

The Dangerous Way.

ladsh Source Code.

The GNU Licenses.

The GNU General Public License.

The GNU Library General Public License.

Glossary.

Bibliography.

Index. 0201308215T04062001

Michael K. Johnson is an operating system engineer at Specifix. He was formerly an operating system developer for Red Hat, where he managed the kernel team for three and a half years, and was founding technical leader of the Fedora Project. He occasionally teaches full-day tutorials on Linux application development.

Erik W. Troan, cofounder and Executive VP of Operating Systems at Specifix, was formerly Vice President of Product Engineering at Red Hat, where he was responsible for specifying and building technologies such as RPM, Linux operating systems, the Red Hat Network, high-performance Web servers, and the infrastructure for Red Hat's Web site.



Author's Support Page http://www.redhat.com/~johnsonm/lad/

This practical reference guides programmers developing Linux applications or porting applications from other platforms. Linux is fundamentally similar to Unixoso, much of the book covers ground familiar to Unix programmersobut this book consistently addresses topics from a Linux point of view. The aim throughout is to provide the detailed information you need to take full advantage of Linux.

If you are already a proficient Unix programmer, this book will greatly facilitate your transition to Linux. You will also find helpful discussions of some tricky Unix topics, such as process and session groups, job control, and tty handling.

If you are a C programmer, 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.

If you are already a Linux programmer, this bookis clear treatment of advanced and otherwise confusing topics will surely make your programming tasks easier.

Linux Application Development is divided into four parts. Part 1 introduces you to Linuxothe operating system, licenses, and documentation. Part 2 covers the most important aspects of the development environmentothe compilers, linker, loader, and debugging tools. Part 3othe heart of the bookodescribes the interface to the kernel and to the core system libraries, including discussion of the process model, file handling, directory operations, signal processing (including the Linux signal API), job control, the POSIX!= termios interface, sockets, and the Linux console. Part 4 describes important development libraries with interfaces more independent of the kernel.

0201308215B04062001

Log in to the Instructor Resource Center

Login name: 

  Password: 

Forgot login/password?  |  Need to redeem an access code?

         

Instructor Resource Center File Download

This work is protected by local and international copyright laws and is provided solely for the use of instructors in teaching their courses and assessing student learning. Dissemination or sale of any part of this work (including on the World Wide Web) will destroy the integrity of the work and is not permitted. The work and materials from this site should never be made available to students except by instructors using the accompanying text in their classes. All recipients of this work are expected to abide by these restrictions and to honor the intended pedagogical purposes and the needs of other instructors who rely on these materials.

Cancel                       I accept, proceed with download

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students contact your Pearson Higher Education representative.