Thông tin tài liệu
www.it-ebooks.info
Professional
Linux
®
Programming
Jon Masters
Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iii
www.it-ebooks.info
01_776130 ffirs.qxp 2/2/07 10:13 PM Page ii
www.it-ebooks.info
Professional
Linux
®
Programming
01_776130 ffirs.qxp 2/2/07 10:13 PM Page i
www.it-ebooks.info
01_776130 ffirs.qxp 2/2/07 10:13 PM Page ii
www.it-ebooks.info
Professional
Linux
®
Programming
Jon Masters
Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iii
www.it-ebooks.info
Professional Linux
®
Programming
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data:
Masters, Jon, 1981-
Professional Linux programming / Jon Masters, Richard Blum.
p. cm.
Includes index.
ISBN: 978-0-471-77613-0 (paper/website)
1. Linux. 2. Operating systems (Computers) I. Blum, Richard, 1962- II. Title.
QA76.76.O63M37153 2007
005.4’32—dc22
2006102202
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be
addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317)
572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.
LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP-
RESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CON-
TENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT
LIMITATION WARRANTIES OF FITNESS FOR APARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED
OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED
HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTAND-
ING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PRO-
FESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT
PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE
LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS
REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMA-
TION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE
ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READ-
ERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR
DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services please contact our Customer Care Department within
the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. Linux is a registered trademark of Linus Torvalds. All
other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any
product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be
available in electronic books.
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iv
www.it-ebooks.info
For Karin, whom I love very much.—Jon Masters
To my wife Barbara.—Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page v
www.it-ebooks.info
About the Authors
Jon Masters is a 25-year-old British-born Linux kernel engineer, embedded systems specialist, and
author who lives and works in the United States for Red Hat. Jon made UK history by becoming one of
the youngest University students the country had ever seen, at the tender age of just 13. Having been
through college twice by the time his peers were completing their first time around, and having been
published over 100 times in a wide range of technical magazines, journals and books, Jon went on to
work for a variety of multinational technology companies. He has worked extensively in the field of
Embedded Systems, Enterprise Linux and Scientific instrumentation and has helped design anything
and everything from Set Top Boxes to future NMR (MRI) imaging platforms.
When not working on Enterprise Linux software for Red Hat, Jon likes to drink tea on Boston Common
and read the collective works of Thomas Paine and other great American Revolutionaries of a bygone
age. He dreams of a time when the world was driven not by electrons, but by wooden sailing ships and
a universal struggle for the birth of modern nations. He plays the violin, and occasionally sings in choral
ensembles, for which he has won several awards. For relaxation, Jon enjoys engaging in a little rock
climbing. He lives in Cambridge, Massachusetts, just across the river Charles from historic Boston, and
enjoys every minute of it.
Jon has extensive experience in speaking about and training people to use a wide variety of Linux
technologies and enjoys actively participating in many Linux User Groups the world over.
Richard Blum has worked for over 18 years for a large U.S. government organization as a network and
systems administrator. During this time he has had plenty of opportunities to work with Microsoft,
Novell, and of course, UNIX and Linux servers. He has written applications and utilities using C, C++,
Java, C#, Visual Basic, and shell script.
Rich has a Bachelors of Science degree in Electrical Engineering, and a Masters of Science degree in
Management, specializing in Management Information Systems, from Purdue University. He is the author
of several books, including “sendmail for Linux” (2000, Sams publishing), “Running qmail” (2000, Sams
publishing), “Postfix” (2001, Sams Publishing), “Open Source E-mail Security” (2001, Sams Publishing),
“C# Network Programming” (2002, Sybex), “Network Performance Open Source Toolkit” (2003, John Wiley &
Sons), and “Professional Assembly Language Programming” (2005, Wrox).
When he is not being a computer nerd, Rich plays electric bass for the church worship and praise band,
and enjoys spending time with his wife Barbara, and daughters Katie Jane and Jessica.
01_776130 ffirs.qxp 2/2/07 10:13 PM Page vi
www.it-ebooks.info
Credits
Contributing Writers
Christopher Aillon
Katherine and David Goodwin
Matthew Walton
Acquisitions Editor
Kit Kemper
Development Editor
Howard A. Jones
Production Editor
Eric Charbonneau
Copy Editor
Foxxe Editorial
Editorial Manager
Mary Beth Wakefield
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Joseph B. Wikert
Graphics and Production Specialists
Carrie A. Foster
Jennifer Mayberry
Barbara Moore
Alicia B. South
Quality Control Technicians
Cynthia Fields
John Greenough
Project Coordinator
Adrienne Martinez
Proofreading and Indexing
Techbooks
Anniversary Logo Design
Richard Pacifico
01_776130 ffirs.qxp 2/2/07 10:13 PM Page vii
www.it-ebooks.info
[...]... Chapter 1: Working with Linux A Brief History of Linux 1 2 The GNU Project The Linux Kernel Linux Distributions Free Software vs Open Source Beginning Development 2 3 4 4 5 Choosing a Linux Distribution Installing a Linux Distribution Linux Community 6 8 15 Linux User Groups Mailing lists IRC Private Communities 15 16 16 16 Key Differences 16 Linux Is Modular Linux Is Portable Linux Is Generic 17 17... particular specialist Linux distribution may not necessarily receive the same level of support as the many hundreds of thousands of people who use another Here are 10 of the more popular Linux distributions available today: ❑ Debian GNU /Linux ❑ Fedora (previously known as Fedora Core) ❑ Gentoo Linux ❑ Mandriva Linux ❑ Red Hat Enterprise Linux (RHEL) ❑ Slackware Linux ❑ OpenSuSE ❑ SuSE Linux Enterprise Server... Working with Linux One of the biggest stumbling blocks when writing software for Linux is understanding what Linux is and is not Linux means different things to different people Technically, Linux itself is an operating system kernel written by the Finnish born Linus Torvalds, though most people today casually refer to an entire Linux- based system by the same name In just a few years, Linux has risen... popular Nevertheless, you will still occasionally see the term “GNU /Linux used to refer to a complete Linux system in recognition of the large part played by the many GNU tools in both building and running any modern Linux system 2 www.it-ebooks.info 04_776130 ch01.qxp 2/2/07 10:11 PM Page 3 Chapter 1: Working with Linux The Linux Kernel The Linux kernel came along much later than the GNU project itself,... Working with Linux Linux Distributions With the growing popularity of the Linux kernel came an interest in making Linux more accessible to those who didn’t already happen to have advanced knowledge of its internal programming To create a usable Linux system, you need more than just the Linux kernel alone In fact, the average Linux desktop system available today makes use of many thousands of individual... experience of others within the Linux community Whatever Linux means to you, you’re reading this book because you’re interested in learning more about becoming a professional Linux programmer As you embark on this journey, you will find it helpful to tool yourself up with an understanding of the different flavors of Linux, how to get going in developing for them, and how working with Linux differs from working... Internet by writing software for the oft-touted LAMP (Linux, Apache, MySQL, Perl/Python) stack Linux is about so much more than just the Linux kernel itself – and it’s important to realize that as a Linux developer Most importantly, this book is about learning It’s about presenting you, the reader, with informed discussion of the key topics that drive Linux development so that you will be better equipped... on Linux systems and discover the wealth of online communities that power the open source revolution Finally, you’ll also discover a few of the ways in which Linux differs from other operating systems you’ve encountered in the past — more on that throughout the rest of the book, too www.it-ebooks.info 04_776130 ch01.qxp 2/2/07 10:11 PM Page 2 Chapter 1: Working with Linux A Brief Histor y of Linux Linux... to make Linux development more interesting, too The earliest work on Linux itself began back in the summer of 1991, but long before there was Linux, there was the GNU project That project had already spent well over a decade working on producing much of the necessary Free Software components in order to be able to create a fully Free operating system, such as Linux Without the GNU project, Linux could... UNIX-like, and Linux systems, software portability from one platform to another, and the tools that facilitate achieving this on modern Linux software distributions You will learn about interacting with Linux systems through network interfaces, graphical user environments, complex modern web-based LAMP stacks, and even address extending the Linux kernel itself You will learn about modern Linux development . ii
www.it-ebooks.info
Professional
Linux
®
Programming
Jon Masters
Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iii
www.it-ebooks.info
Professional Linux
®
Programming
Published. Data:
Masters, Jon, 1981-
Professional Linux programming / Jon Masters, Richard Blum.
p. cm.
Includes index.
ISBN: 978-0-471-77613-0 (paper/website)
1. Linux. 2. Operating
Ngày đăng: 06/03/2014, 17:20
Xem thêm: Professional Linux Programming pot, Professional Linux Programming pot