UNIX™ System Programming

Keith Haviland, Ben Salama

Publisher: Addison-Wesley, 1987, 339 pages

ISBN: 0-201-12919-1

Keywords: Programming

Last modified: May 15, 2021, 2:53 a.m.

A Programmer's Guide to Software Development

The UNIX operating system has become a de facto standard for a new generation of multi-user micro-, mini-, and mainframe computers. This book provides a lucid and well-structured guide to UNIX software development in the C language for professional programmers.

The book concentrates on a detailed study of the UNIX system call interface, that is the programming interface existing between the UNIX kernel and applications software running in the UNIX environment. In addition, some of the more important subroutine libraries are covered. Fundamental techniques are developed in depth and fully supported with program examples. All the examples will run on any conforming to issue 2 of AT&T's System V Interface Definition. The text is also highly relevant to the two other important standards — the X/Open portability guide and the IEEE draft POSIX standard.

From a wealth of experience in developing systems and applications software, and a real appreciation of the needs of UNIX system programmers, the authors know that computing is not a spectator sport. Throughout the book there is a strong emphasis on exercises and examples.

  1. Basic Concepts and terminology
    1. The file
    2. The process
    3. System calls and library subroutines
  2. The File
    1. UNIX file access primitives
    2. Standard input, standard output, and standard error
    3. The Standard I/O Library: a look ahead
    4. The errno variable and system calls
  3. The File in Context
    1. Files in a multi-user environment
    2. Files with multiple names
    3. Obtaining file information: stat and fstat
  4. Directories, File Systems and Special Files
    1. Introduction
    2. Directories and the AT&T System V Interface Definition
    3. Directories:  the user view
    4. The implementation of a directory
    5. Programming with directories
    6. UNIX file systems
    7. UNIX special files
  5. The Process
    1. Review of the notation of a process
    2. Creating processes
    3. Running new programs with exec
    4. Using exec and fork together
    5. Inherited data and file descriptors
    6. The exit system call
    7. Synchronizing processes with wait
    8. Zombies and premature exits
    9. smallsh: a command processor
    10. Process attributes
  6. Interprocess Communication: 1
    1. Introduction
    2. Signals
    3. Interprocess communications using pipes
    4. FIFOs or named pipes
  7. Interprocess Communications: 2
    1. Introduction
    2. Record locking
    3. IPC facilities
  8. The Terminal
    1. Introduction
    2. The UNIX Terminal
    3. The program's view
    4. The connect example
    5. The past
    6. And the future
  9. The Standard I/O Library
    1. Introduction
    2. Streams and FILE structures
    3. Opening and closing streams: fopen and fclose
    4. Single-character I/O: getc and putc
    5. Pushing back characters onto a stream: ungetc
    6. Standard input, standard output and standard error
    7. Standard I/O status routines
    8. Input and output by line
    9. Binary input and output: fread and fwrite
    10. Random file access: fseek, rewind, ftell
    11. Formatted output: the printf family
    12. Formatted input: the scanf family
    13. Running programs with the Standard I/O Library
    14. Miscellaneous calls
  10. Screen Handling
    1. Introduction
    2. The curses library: an overview
    3. General structure of a curses program
    4. Mode setting
    5. Writing characters and strings
    6. Formatted output
    7. Cursor movement
    8. Input from the keyboard: getch
    9. Input from the screen: inch
    10. Editing an existing screen
    11. Video attributes
    12. Creating and manipulating new windows
    13. A curses example: domenu
    14. Low-level terminal control: terminfo
  11. Miscellaneous System Calls and Library Routines
    1. Introduction
    2. Dynamic memory management
    3. Time
    4. String and character manipulation
    5. A selection of other useful functions
  1. errno Error Codes and Library Routines

Reviews

UNIX™ System Programming

Reviewed by Roland Buresund

OK ***** (5 out of 10)

Last modified: May 21, 2007, 2:47 a.m.

A classical beginners text on how to program in a UNIX environment. Unfortunately obsolete today.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required