STREAMS Programming Guide
只搜寻这本书
以 PDF 格式下载本书

Introduction

1

Introduction to This Guide

This guide provides information to developers on the use of the STREAMS mechanism at user and kernel levels. STREAMS was developed to augment the character input/output mechanism and to support development of communication services.
STREAMS provides developers with integral functions, a set of utility routines, and facilities that speed software design and implementation.

Audience

The guide is intended for network and systems programmers who use the STREAMS mechanism at user and kernel levels for UNIX system communication services.
Readers of the guide are expected to possess prior knowledge of the UNIX system, programming, networking, and data communication. It is also assumed that the reader is familiar with the book Writing Device Drivers.

Organization

This guide has several chapters, each discussing a unique topic. Chapters 2, 3, and 4 have introductory information and can be ignored by those readers already familiar with STREAMS concepts and facilities.

Code Examples

All code examples used in this book conform to ANSI C specifications.

Conventions Used

Throughout this guide, the word "STREAMS" refers to the mechanism and the word "Stream" refers to the path between a user application and a driver. In connection with STREAMS-based pipes, "Stream" refers to the data transfer path in the kernel between the kernel and one or more user processes.
Examples are given to highlight the most important and common capabilities of STREAMS. They are not exhaustive and, for simplicity, reference fictional drivers and modules. Where possible, examples will be runnable code.
Command names, C code, UNIX code, system calls, STREAMS utility routines, header files, data structures, declarations, short examples, filenames, and path names are printed in listing (constant width) font.
User input is in listing font when by itself, or bold listing font when used in combination with computer output.

  Screens are used to simulate what a user will see on a  
  video display screen or to show program source code.  
  
  Data structure contents and formats are also shown in screens.  

Items being emphasized, variable names, and parameters are printed in italics.

Imported image(39x43)

Warning - The warning sign is used to show possible damage to data, system, application, or person.

CAUTION Caution - The caution sign is used to show possible harm or damage to a system, an application, a process, or a piece of hardware.


Note - Notes are used to emphasize points of interest, to present parenthetical information, and to cite references to other documents and commands.

Other Documentation

Though the STREAMS Programming Guide is a principal tool to aid in developing STREAMS applications, readers are encouraged to obtain more information on both system calls and utilities used by STREAMS from the manual pages. See Appendix F, "Manual Pages";" for a complete list of the available manual pages. The actual manual pages are in the SunOS man Pages(2): System Calls and the man Pages(3): Library Routines.
For more information on driver related issues, such as autoconfiguration, see Writing Device Drivers.
For a complete list of books about SunOS/SVR4, see the Solaris Roadmap to Documentation.