AdvancedLinuxProgrammingContentsAtaGlanceIAdvancedUNIXProgrammingwithLinux1GettingStarted32WritingGoodGNU/LinuxSoftware173Processes454Threads615InterprocessCommunication95IIMasteringLinux6Devices1297The/procFileSystem1478LinuxSystemCalls1679InlineAssemblyCode18910Security19711ASampleGNU/LinuxApplication219IIIAppendixesAOtherDevelopmentTools259BLow-LevelI/O281CTableofSignals301DOnlineResources303EOpenPublicationLicenseVersion1.0305FGNUGeneralPublicLicense309AdvancedLinuxProgramming201West103rdStreet,Indianapolis,Indiana46290AnImprintofPearsonEducationBoston•Indianapolis•London•Munich•NewYork•SanFranciscoMarkMitchell,JeffreyOldham,andAlexSamuelwww.newriders.comPublisherDavidDwyerAssociatePublisherAlValvanoExecutiveEditorStephanieWallManagingEditorGinaBrownAcquisitionsEditorAnnQuinnDevelopmentEditorLauraLoveallProductMarketingManagerStephanieLaytonPublicityManagerSusanPetroProjectEditorCarolineWiseCopyEditorKristaHansingSeniorIndexerCherylLenserManufacturingCoordinatorJimConwayBookDesignerLouisaKlucznikCoverDesignerBrainstormDesign,Inc.CoverProductionArenHowellProofreaderDebraNeelCompositionAmyParkerAdvancedLinuxProgrammingCopyright©2001byNewRidersPublishingFIRSTEDITION:June,2001Allrightsreserved.Nopartofthisbookmaybereproducedortransmittedinanyformorbyanymeans,electronicormechanical,includingphotocopying,recording,orbyanyinformationstorageandretrievalsystem,withoutwrittenpermissionfromthepublisher,exceptfortheinclusionofbriefquotationsinareview.InternationalStandardBookNumber:0-7357-1043-0LibraryofCongressCatalogCardNumber:00-10534305040302017654321Interpretationoftheprintingcode:Therightmostdouble-digitnumberistheyearofthebook’sprinting;theright-mostsingle-digitnumberisthenumberofthebook’sprinting.Forexample,theprintingcode01-1showsthatthefirstprintingofthebookoccurredin2001.ComposedinBemboandMCPdigitalbyNewRidersPublishing.PrintedintheUnitedStatesofAmerica.TrademarksAlltermsmentionedinthisbookthatareknowntobetrademarksorservicemarkshavebeenappropriatelyca...