Skip to main content

Beginning Linux® Programming, 3rd Edition

Beginning Linux® Programming, 3rd Edition

Neil Matthew, Richard Stones, Alan Cox (Foreword by)

ISBN: 978-0-764-54497-2

Jan 2004

888 pages

Select type: Paperback

Product not available for purchase

Description

What is this book about?

If you have some programming experience and are ready to venture into Linux programming, this updated edition of the bestselling entry-level book takes you there. The authors guide you step by step, using construction of a CD database application to give you hands-on experience as you progress from the basic to the complex. You’ll start with fundamental concepts like writing Unix programs in C. You’ll learn basic system calls, file I/O, interprocess communication, and shell programming. You’ll become skilled with the toolkits and libraries for working with user interfaces.

The book starts from the basics, explaining how to compile and run your first program. New to this edition are chapters on MySQL® access and administration; programming GNOME and KDE; and Linux standards for portable applications. Coverage of kernel programming, device drivers, CVS, grep, and GUI development environments has expanded. This book gives you practical knowledge for real wor ld application.

What does this book cover?

In this book, you will learn how to

  • Develop programs to access files and the Linux environment
  • Use the GNU compiler, debugger and other development tools
  • Program data storage aapplications for MySQL and DBM database systems
  • Write programs that take advantage of signals, processes and threads
  • Build graphical user interfaces using both the GTK (for GNOME) and Qt (for KDE) libraries
  • Write device drivers that can be loaded into the Linux kernel
  • Access the network using TCP/IP sockets
  • Write scripts that use grep, regular expressions and other Linux facilities

Who is this book for?

This book is for programmers with some C or C++ experience, who want to take advantage of the Linux development environment. You should have enough Linux familiarity to have installed and configured users on Linux.

Foreword by Alan Cox.

Introduction.

Chapter 1: Getting Started.

Chapter 2: Shell Programming.

Chapter 3: Working with Files.

Chapter 4: The Linux Environment.

Chapter 5: Terminals.

Chapter 6: Managing Text-Based Screens with curses.

Chapter 7: Data Management.

Chapter 8: MySQL.

Chapter 9: Development Tools.

Chapter 10: Debugging.

Chapter 11: Processes and Signals.

Chapter 12: POSIX Threads.

Chapter 13: Inter-Process Communication: Pipes.

Chapter 14: Semaphores, Shared Memory, and Message Queues.

Chapter 15: Sockets.

Chapter 16: Programming GNOME Using GTK+.

Chapter 17: Programming KDE Using Qt.

Chapter 18: Device Drivers.

Chapter 19: Standards for Linux.

Index.

What does this book cover?

In this book, students will learn how to

  • Develop programs to access files and the Linux environment
  • Use the GNU compiler, debugger and other development tools
  • Program data storage aapplications for MySQL and DBM database systems
  • Write programs that take advantage of signals, processes and threads
  • Build graphical user interfaces using both the GTK (for GNOME) and Qt (for KDE) libraries
  • Write device drivers that can be loaded into the Linux kernel
  • Access the network using TCP/IP sockets
  • Write scripts that use grep, regular expressions and other Linux facilities

Who is this book for?

This book is for students with some C or C++ experience, who want to take advantage of the Linux development environment.

Download the Application code for Chapter 8. Download
Download the 544977_code.tgz file into a suitable directory, Download
7Error in Code,$ cat hello.c
#include <stdio.h>

int main()
{
printf( Hello World\n );
exit(0);
}
$

Should be:

$ cat hello.c
#include <stdio.h>
#include <stdlib.h>

int main()
{
printf( Hello World\n );
exit(0);
}
$
10/11/05
13Error in text,The .so libraries correspond to .DLL files and are required at run time, while the .sa libraries are similar to .LIB files included in the program exevutable.

Should be:

The .so libraries correspond to .DLL files and are required at run time, while the .a libraries are similar to .LIB files included files included in the program exevutable.
7/19/05
38Error in Variable,Under Try It Out --for Loop with Wildcard Expansion :
last sentence in the second paragraph reads:
Each of these in turn is used as the variable $i inside the for loop.

should be:
Each of these in turn is used as the variable $file inside the for loop.
02/10/07
199Error in sample program,The sample program on page 199 is in error, there should be no (int *) on the affected line.
The line: tputs(clear, 1, (int *) char_to_terminal);
should read: tputs(clear, 1, char_to_terminal);
12/1/04
243-244Error in Try It Out,Try It Out - Querying the CD Database section:
the find_cd method has the following three lines interspersed in the logic:
if (found == strstr(catalog, , )) {
if (found == strstr(title, , )) {
if (found == strstr(title, match)) {

In all these lines the comparison operator (==) should be replaced with the assignment operator (=) for the code to work properly.
03/12/07
237Error in Try It Out,In the Try It Out - The Menu section:
the draw_menu method increments the txt_ptr in the while loop.

This line (txt_ptr++) should be deleted, because it causes the truncation of the first character in every option line when the menu is displayed.
03/12/07
301Error in Text,In Makefile logic:
access.c and access.o

should be:
cd_access.c and cd_access.o.
04/06/07
313New Heading,Second paragraph:
requires new heading after first section:
mysqldump
8-14-06