Cover image for Advanced UNIX programming
Title:
Advanced UNIX programming
Author:
Gay, Warren.
Personal Author:
Publication Information:
Indianapolis, Ind. : Sams Pub., [2000]

©2000
Physical Description:
xvii, 604 pages : illustrations ; 24 cm
General Note:
Includes index.
Language:
English
Title Subject:
ISBN:
9780672319907
Format :
Book

Available:*

Library
Call Number
Material Type
Home Location
Status
Central Library QA76.76.O63 G3886 2000 Adult Non-Fiction Central Closed Stacks
Searching...
Central Library QA76.76.O63 G3886 2000 Adult Non-Fiction Central Closed Stacks
Searching...

On Order

Summary

Summary

PLEASE PROVIDE COURSE INFORMATIONPLEASE PROVIDE


Author Notes

Warren Gay is a Supervisor at Mackenzie Financial Corporation, in Toronto.There he supervises a small team of programmers that manage the Mackenzie Investment Management System (IMS.) Warren is the author of Sams' Teach Yourself Linux Programming in 24 Hours (published 1999) and Linux Socket Programming by Example (due April 2000). Amateur radio is a hobby of Warren's. He holds an advanced amateur radio license and is occasionally active on 75 meters with radio call sign VE3WWG.Using the 2-meter band on August 3, 1991, he made contact with Musa Manarov,call sign U2MIR, aboard the Soviet MIR space station using his PC and packet radio gear.Warren has been programming professionally since 1980, using many assembler languages, PL/I, C and C++. He has been programming for UNIX since 1986, and started programming for Linux in 1994. Linux has allowed him to contribute software packages such as the ftpbackup program and the rewrite of the popular wavplay program. These and his other LINUX packages can be found at sunsite.unc.edu and its mirror ftp sites. Warren lives with his wife Jacqueline, and his three children Erin, Laura, and Scott in St. Catharines, Ontario, Canada.


Table of Contents

Introductionp. 1
Part 1 Files and Directoriesp. 7
Chapter 1 Compiler Notes and Optionsp. 9
Online Manual Pagesp. 9
Example Code in This Bookp. 12
Compiling C Programsp. 13
Managing Compiler Warningsp. 18
Compiling to Standardsp. 25
Summaryp. 30
Chapter 2 UNIX File System Objectsp. 33
File System Objectsp. 33
Permissionsp. 41
Working with Files Under UNIXp. 43
UNIX File I/Op. 49
Summaryp. 50
Chapter 3 Error Handling and Reportingp. 51
Determining Success or Failurep. 51
Determining the Reason for Failurep. 52
The Old errno Valuep. 53
The New errno Valuep. 56
Reporting on errno Valuesp. 57
Testing for Errors Using stdio(3)p. 62
Summaryp. 64
Chapter 4 UNIX Input and Outputp. 65
The umask(2) Function and umask Bitsp. 65
Reading and Writingp. 70
Seeking Within a Filep. 74
Truncating Filesp. 75
Sparse Filesp. 77
Forcing Data to Mediap. 79
Scattered Reading and Writingp. 81
Determining Your tty Namep. 83
Summaryp. 85
Chapter 5 File Lockingp. 87
Understanding Lock Typesp. 87
The Lock File Techniquep. 89
Record Lockingp. 96
Summaryp. 103
Chapter 6 Managing Files and Their Propertiesp. 105
Removing Filesp. 105
Linking Filesp. 106
Moving Filesp. 107
Obtaining File System Informationp. 108
Testing Access to a Filep. 119
Symbolic Linksp. 120
File Permissions and Ownershipp. 122
Named Pipes (FIFOs)p. 124
Obtaining Size and Configuration Informationp. 125
Summaryp. 128
Chapter 7 Directory Managementp. 129
Obtaining the Working Directoryp. 129
Changing the Current Directoryp. 130
Making a New Directoryp. 132
Removing a Directoryp. 133
Opening a Directory for Searchingp. 134
Closing a Directoryp. 135
Searching a Directoryp. 136
Rewinding to the Start of a Directoryp. 138
Saving Position Within a Directoryp. 138
Restoring Position Within a Directoryp. 139
Scanning a Directoryp. 139
Walking a Directory Structurep. 144
Changing Your Root Directoryp. 146
Summaryp. 149
Chapter 8 Temporary Files and Process Cleanupp. 151
Creating Temporary Filesp. 151
Making Files Temporaryp. 161
Summaryp. 169
Part II Library Functionsp. 171
Chapter 9 UNIX Command-Line Processingp. 173
Command-Line Conventionsp. 173
Arguments That Look Like Optionsp. 174
The getopt(3) Functionp. 175
The getsubopt(3) Functionp. 179
GNU Long Options Extensionp. 183
Summaryp. 187
Chapter 10 Conversion Functionsp. 189
Simple Conversion Functionsp. 189
Using sscanf(3) for Conversion and Validationp. 192
The strtol(3) and strtoul(3) Functionsp. 194
Large Integer Conversionsp. 201
BSD strtoq(3) and strtouq(3) Functionsp. 202
The strtod(3) Functionp. 202
Summaryp. 205
Chapter 11 UNIX Date and Time Facilitiesp. 207
Time Zonesp. 207
Defining the Date and Time Data Typep. 209
Time Conversion Functionsp. 210
Customizing Date and Time Formats with strftime(3)p. 221
Summaryp. 226
Chapter 12 User, Password, and Group Managementp. 227
Introduction to UNIX User Managementp. 227
The getuid(2) and geteuid(2) Functionsp. 228
The getgid(2) and getegid(2) Functionsp. 229
Real, Effective, and Saved User IDp. 229
Setting User IDp. 230
Setting Group IDp. 232
The FreeBSD Function issetugid(2)p. 232
The /etc/passwd Filep. 233
The Password Database Routinesp. 235
The Group Databasep. 238
Related Re-entrant Functionsp. 241
Supplementary Groupsp. 242
Summaryp. 246
Chapter 13 Static and Shared Librariesp. 247
The Static Libraryp. 247
The Shared Libraryp. 256
Comparing Static and Shared Librariesp. 261
Dynamic Library Loadingp. 264
Summaryp. 271
Chapter 14 Database Library Routinesp. 273
The NDBM Databasep. 274
An NDBM Database Examplep. 280
Summaryp. 303
Part III Advanced Conceptsp. 305
Chapter 15 Signalsp. 307
Understanding UNIX Signalsp. 307
Reliable and Unreliable Signalsp. 308
The Unreliable signal(3) APIp. 308
The Reliable Signal APIp. 311
Controlling Signalsp. 317
Applying the alarm(3) Functionp. 320
Calling Functions from a Signal Handlerp. 322
Applying the EINTR Error Codep. 325
Raising Signalsp. 326
Summaryp. 328
Chapter 16 Efficient I/O Schedulingp. 329
Non-Blocking I/Op. 329
I/O Scheduling Functionsp. 333
I/O Pollingp. 342
Summaryp. 349
Chapter 17 Timersp. 351
The Sleep Functionsp. 351
Interval Timer Functionsp. 361
Summaryp. 369
Chapter 18 Pipes and Processesp. 371
UNIX Pipesp. 371
External Processes Without Pipesp. 379
Summaryp. 384
Chapter 19 Forked Processesp. 385
Overview of the UNIX Fork Processp. 385
The fork(2) Functionp. 387
Waiting for Process Completionp. 389
Executing New Programsp. 397
Summaryp. 403
Chapter 20 Pattern Matchingp. 405
Shell Patternsp. 405
String Pattern Functionsp. 408
The glob(3) Functionp. 416
Summaryp. 429
Chapter 21 Regular Expressionsp. 431
Understanding Regular Expressionsp. 431
The Regular Expression Libraryp. 436
Summaryp. 446
Chapter 22 Interprocess Communication Conceptsp. 447
Types of IPCp. 447
The Message Queuep. 448
Shared Memoryp. 450
Semaphoresp. 450
Referencing IPC Resourcesp. 452
Destroying IPC Resourcesp. 454
Summaryp. 455
Chapter 23 Message Queuesp. 457
Controlling a Message Queuep. 457
Sending and Receiving Messagesp. 460
Applying Message Queuesp. 463
Summaryp. 479
Chapter 24 Semaphoresp. 481
Semaphore Utility Programp. 481
Creating and Accessing Semaphore Setsp. 483
Destroying Semaphore Setsp. 486
Controlling Semaphoresp. 488
Using Semaphoresp. 500
Summaryp. 514
Chapter 25 Shared Memoryp. 515
The globvar Utility Programp. 515
Shared Memory System Callsp. 518
Using Shared Memoryp. 526
Summaryp. 535
Chapter 26 Memory-Mapped Filesp. 537
Determining the Page Sizep. 538
Creating Memory Mappingsp. 539
Controlling Memory-Mapped Regionsp. 548
Destroying Memory Mappingsp. 554
Summaryp. 555
Chapter 27 X Window Programmingp. 557
Event-Driven Programmingp. 557
An Xlib Client Programp. 561
Summaryp. 575
Indexp. 577

Google Preview