Contents <br> Preface ix <br> <br> 1 Introduction 1 <br> 1.1 What is System Programming? 1 <br> 1.2 The Three Tools 5 <br> 1.3 How to Debug 20 <br> 1.4 Program Development 31 <br> 1.5 Review of C 35 <br> Questions and Exercises 41 <br> <br> 2 Bits, Bytes, and Data Types 45 <br> 2.1 Bit Models 45 <br> 2.2 Bitwise Operations 57 <br> 2.3 Memory Map 65 <br> Questions and Exercises 68 <br> <br> 3 Arrays and Strings 73 <br> 3.1 Arrays 74 <br> 3.2 Strings 79 <br> 3.3 String Library Functions 83 <br> 3.4 Command Line Arguments 92 <br> Questions and Exercises 94 <br> <br> 4 Pointers and Structures 103 <br> 4.1 Pointers 103 <br> 4.2 Using Pointers 108 <br> 4.3 Structures 118 <br> 4.4 Using Structures 121 <br> Questions and Exercises 127 <br> <br> 5 Input/Output 135 <br> 5.1 Streams 136 <br> 5.2 Buffers 143 <br> 5.3 Pipes 145 <br> 5.4 Files 153 <br> 5.5 Devices 161 <br> Questions and Exercises 164 <br> <br> 6 ProgramManagement 171 <br> 6.1 Program Building 172 <br> 6.2 Code Organization 185 <br> 6.3 Program Distribution Methods 201 <br> Questions and Exercises 204 <br> <br> 7 System Calls 213 <br> 7.1 Families of Operations 214 <br> 7.2 Libraries and System Calls 215 <br> 7.3 Process System Calls 217 <br> 7.4 Signal System Calls 229 <br> 7.5 Socket System Calls 236 <br> Questions and Exercises 251 <br> <br> 8 Libraries 255 <br> 8.1 Using a Library 256 <br> 8.2 Purpose of Libraries 261 <br> 8.3 The C Standard Library 263 <br> 8.4 The Curses Library 265 <br> 8.5 The X Library 275 <br> 8.6 Making a Library 288 <br> 8.7 Library Pitfalls 291 <br> Questions and Exercises 292 <br> <br> 9 Scripting Languages 299 <br> 9.1 Using Scripting Languages 301 <br> 9.2 Shell Scripting 305 <br> 9.3 Perl 320 <br> 9.4 MATLAB 333 <br> 9.5 Discussion 347 <br> Questions and Exercises 348 <br> <br> A ASCII Table 351 <br> B Common Shell Commands 355 <br> C System Programs 357 <br> Index 361 <br>