oracle home
STREAMS Programming Guide
Exit Print View
Search Term
Search Scope:
This Document
Entire Library
» ...
Index S
Updated: July 2014
STREAMS Programming Guide
Document Information
Using This Documentation
Product Documentation Library
Access to Oracle Support
Feedback
Part I Application Programming Interface
Chapter 1 Overview of STREAMS
What Is STREAMS?
STREAMS Definitions
Stream as a Data Path
Stream Head
STREAMS Module
STREAMS Device Driver
STREAMS Data
Message Queues
Communicating With a STREAMS Device
STREAMS Multiplexing
STREAMS Polling
Message Transfer Flow Control
When to Use STREAMS
How STREAMS Works???Application Interface
Opening a Stream
Closing a Stream
Controlling Data Flow
Simple Stream Example
How STREAMS Works at the Kernel Level
Creating the Stream Head
Message Processing
Structure of a STREAMS Device Driver
Message Components
Message Queueing Priority
Structure of a Message Queue
Configuring Multiplexed Streams
Multithreading the Kernel
Service Interfaces
Manipulating Modules
Protocol Portability
Protocol Substitution
Protocol Migration
Module Reusability
Chapter 2 STREAMS Application-Level Components
STREAMS Interfaces
STREAMS System Calls
Action Summary
Opening a STREAMS Device File
Initializing Details
Queue Allocation
Adding and Removing Modules
Closing the Stream
Stream Construction Example
Inserting Modules
Module and Driver Control
Chapter 3 STREAMS Application-Level Mechanisms
Message Handling
Modifying Messages
Message Types
Control of Stream Head Processing
Read Options
Write Options
Message Queueing and Priorities
Controlling Data Flow and Priorities
Accessing the Service Provider
Closing the Service Provider
Sending Data to the Service Provider
Receiving Data
Input and Output Polling
Synchronous Input and Output
Asynchronous Input and Output
signal Message
Extended Signals
Stream as a Controlling Terminal
Job Control
Allocation and Deallocation of Streams
Hungup Streams
Hangup Signals
Accessing the Controlling Terminal
Chapter 4 Application Access to the STREAMS Driver and Module Interfaces
System Calls Used
Module and Driver ioctl Calls
General ioctl Processing
I_STR ioctl Processing
Transparent ioctl Processing
I_LIST ioctl
Other ioctl Commands
Message Direction
Flush Handling
Chapter 5 STREAMS Administration
Administration Tools
Autopush Facility
Application Interface
Administration Tool Description
strace Command
strlog Command
strqget Command
strqset Command
strerr Daemon
Chapter 6 Pipes and Queues
Overview of Pipes and FIFOs
Creating and Opening Pipes and FIFOs
Using Pipes and FIFOs
Reading From a Pipe or FIFO
Writing to a Pipe or FIFO
Zero-Length Writes
Atomic Writes
Closing a Pipe or FIFO
Flushing Pipes and FIFOs
Named Streams
Unique Connections
Part II Kernel Interface
Chapter 7 STREAMS Framework ??? Kernel Level
Overview of Streams in Kernel Space
Stream Head
Kernel???Level Messages
Message Types
Message Structure
Message Linkage
Queued Messages
Shared Data
Sending and Receiving Messages
Data Alignment
Message Queues and Message Priority
Message Queues
queue Structure
Using Queue Information
Entry Points
open Routine
close Routine
put Procedure
Queue service Procedure
qband Structure
Using qband Information
Message Processing Procedures
Flow Control in Service Procedures
Chapter 8 STREAMS Kernel-Level Mechanisms
ioctl Processing
Message Allocation and Freeing
Recovering From No Buffers
Read Device Interrupt Handler
Write Service Procedure
Releasing Callback Requests
Extended STREAMS Buffers
esballoc9F Example
General ioctl Processing
STREAMS ioctl Issues
I_STR ioctl Processing
Transparent ioctl
Transparent ioctl Messages
Transparent ioctl Examples
M_COPYIN Example
M_COPYOUT Example
Bidirectional Data Transfer Example
I_LIST ioctl2Example
M_FLUSH Message Handling
Flushing According to Priority Bands
Flushing Priority Band
Driver and Module Service Interfaces
Service Interface Library Example
Module Service Interface Example
Service Primitive Declarations
Service Interface Procedure
Message Type Change Rules
Common ioctl Interfaces
FIORDCHK
FIONREAD
I_NREAD
signal Message
Chapter 9 STREAMS Drivers
STREAMS Device Drivers
Basic Driver
STREAMS Driver Entry Points
STREAMS Configuration Entry Points
STREAMS Initialization Entry Points
STREAMS Table-Driven Entry Points
STREAMS Queue Processing Entry Points
STREAMS Interrupt Handlers
Driver Unloading
STREAMS Driver Code Samples
Printer Driver Example
Driver Flush Handling
Print Driver Interrupt
Driver Flow Control
Cloning STREAMS Drivers
Loop-Around Driver
Summarizing STREAMS Device Drivers
Chapter 10 STREAMS Modules
Module Overview
STREAMS Module Configuration
Module Procedures
Filter Module Example
Data Flow Control
Design Guidelines
htonl3B and ntohl3B
Chapter 11 Configuring STREAMS Drivers and Modules
Kernel Data Structures
modlinkage
modldrv
modlstrmod
dev_ops
cb_ops
streamtab
qinit
STREAMS Driver Entry Points
pts Example
STREAMS Module Configuration
Compilation
Kernel Loading
Checking the Module Type
Tunable Parameters
STREAMS Administrative Driver
Application Interface
STREAMS Anchors
Anchors and Data Flow
Using Anchors
Chapter 12 Multithreaded STREAMS
Multithreaded (MT) STREAMS Overview
MT STREAMS Framework
STREAMS Framework Integrity
Message Ordering
MT STREAMS Perimeters
Inner Perimeters
Outer Perimeters
PERMOD Perimeter
Hot Perimeters
Defining Perimeter Types
Choosing a Perimeter Type
MT SAFE Modules and Drivers
MT SAFE Module
MT SAFE Driver
Routines Used Inside a Perimeter
qprocson/qprocsoff
qtimeout/qunbufcall
qwriter
qwait
Asynchronous Callback Functions
close Race Conditions
Unloading a Module that Uses esballoc
Use of the q_next Field
MT SAFE Modules Using Explicit Locks
Constraints When Using Locks
Preserving Message Ordering
Preparing to Port
Porting to the SunOS 5 System
Sample Multithreaded Device Driver Using a Per Module Inner Perimeter
Sample Multithreaded Module With Outer Perimeter
Chapter 13 STREAMS Multiplex Drivers
STREAMS Multiplexers
Building a Multiplexer
Dismantling a Multiplexer
Routing Data Through a Multiplexer
Connecting And Disconnecting Lower Streams
Connecting Lower Streams
Disconnecting Lower Streams
Multiplexer Construction Example
Multiplexing Driver Example
Upper Write put Procedure Sample
Upper Write service Procedure Sample
Lower Write service Procedure
Lower Read put Procedure
Persistent Links
Design Guidelines
Part III Advanced Topics
Chapter 14 Debugging STREAMS-based Applications
Kernel Debug Printing
STREAMS Error and Trace Logging
Kernel Examination Tools
crash Command
adb Command
kadb Command
Part IV Appendixes
Appendix A Message Types
Ordinary Messages
M_BREAK
M_CTL
M_DATA
M_DELAY
M_IOCTL
M_PASSFP
M_PROTO
M_RSE
M_SETOPTS
M_SIG
High-Priority Messages
M_COPYIN
M_COPYOUT
M_ERROR
M_FLUSH
M_HANGUP
M_IOCACK
M_IOCDATA
M_IOCNAK
M_PCPROTO
M_PCRSE
M_PCSIG
M_READ
SO_MREADOFF and M_STOP
SO_MREADOFFI and M_STOPI
M_UNHANGUP
Appendix B Kernel Utility Interface Summary
Appendix C STREAMS-Based Terminal Subsystem
Overview of Terminal Subsystem
Master Driver and Slave Driver Characteristics
Line-Discipline Module
Default Settings
Module open and close Routines
Read-Side Processing
Write-Side Processing
EUC Handling in ldterm
Hardware Emulation Module
STREAMS-based Pseudo-Terminal Subsystem
Line-Discipline Module
Pseudo-TTY Emulation Module: ptem
ptem Data Structure
open and close Routines
Remote Mode
Packet Mode
Pseudo-TTY Drivers: ptm and pts
grantpt
unlockpt
ptsname
Pseudo-TTY Streams
Appendix D STREAMS FAQ
Glossary
Index
Index Numbers and Symbols
Index A
Index B
Index C
Index D
Index E
Index F
Index G
Index H
Index I
Index J
Index K
Index L
Index M
Index N
Index O
Index P
Index Q
Index R
Index S
Index T
Index U
Index W
Language:
English
S
sad
STREAMS Administrative Driver
SAD
(
see
STREAMS Administrative Driver)
Application Interface
STREAMS Administrative Driver
Application Interface
SAD_GAP
ioctl
strapush Structure
SAD_SAP
ioctl
SAP_ALL
option
strapush Structure
SAP_CLEAR
option
strapush Structure
SAP_ONE
option
strapush Structure
SAP_RANGE
option
strapush Structure
sap_lastminor
device
strapush Structure
sap_major
device
strapush Structure
sap_minor
device
strapush Structure
strapush Structure
send data to service provider
example
inter_snd
service
interface
service interface
procedure
service procedure
provider
service provider
user
service user
service interface
Service Interface
definition
Driver and Module Service Interfaces
rules
Module Service Interface Example
service interface library
example
Service Interface Library Example
primitives
Service Interface Library Header File
service interface library header file
example
Service Interface Library Example
service interface
protoput
procedure
example
Service Interface Procedure
service primitive
Service Interface
BIND_REQ
Service Interface Library Header File
ERROR_ACK
Service Interface Library Header File
in
service
procedure
Service Interface Library Header File
OK_ACK
Service Interface Library Header File
UNITDATA_IND
Service Interface Library Header File
UNITDATA_REQ
Service Interface Library Header File
service primitive declarations
example
Service Primitive Declarations
service procedure
Flow Control Mechanism
Queue service Procedure
back-enable
back-enable
blocked
blocked
service provider
Service Interface
accessing
Accessing the Service Provider
closing
Closing the Service Provider
receiving data
Receiving Data
sending data
Sending Data to the Service Provider
service
interface
Service Interfaces
service
procedure
Structure of a Message Queue
signal
signal Message
extended
Extended Signals
in job control management
Job Control
in STREAMS
signal Message
signal Message
M_SIG
signal Message
SIGCONT
Job Control
SIGHUP
Hangup Signals
SIGPOLL
M_SIG
SIGSTOP
Job Control
SIGTSTP
Job Control
SIGTTIN
Job Control
SIGTTOU
Job Control
SIGPOLL
signal
M_SIG
SIGTTIN
Accessing the Controlling Terminal
SIGTTOU
Accessing the Controlling Terminal
simple stream
example
Simple Stream
slave driver
slave driver
in pseudo-tty subsystem
STREAMS-based Pseudo-Terminal Subsystem
open
Pseudo-TTY Drivers: ptm and pts
slave driver open
example
Pseudo-TTY Drivers: ptm and pts
SO_FLAG
in
M_SETOPTS
M_SETOPTS
SO_MREADOFF
SO_MREADOFF and M_STOP
SO_MREADOFI
SO_MREADOFFI and M_STOPI
standard pipe
standard pipe
str_mlist structure
example
I_LIST ioctl
strace
strace Command
strapush structure
example
Application Interface
strchg
I_LIST ioctl
strconf
command
I_LIST ioctl
STRCTLSZ
tunable parameter
Tunable Parameters
stream
controlling terminal
Allocation and Deallocation of Streams
general definition
What Is STREAMS?
hung-up
Hungup Streams
stream autopush structure
example
Application Interface
stream construction
add/remove modules
Adding and Removing Modules
close a stream
Closing the Stream
example
Process Input
Stream Construction Example
open a stream
Opening a STREAMS Device File
stream head
copy data between the user space and kernel space
Stream Head
intercepting
I_STR
strioctl Structure
kernel space interaction
Stream Head
stream pseudo terminal module
example
Stream Pseudo Terminal Module
streamio
ioctl
commands
streams control
Other ioctl Commands
STREAMS
STREAMS
administration tools
Administration Tools
application interface
How STREAMS Works???Application Interface
asynchronous callback functions
Asynchronous Callback Functions
closing a device
Closing a Stream
configuration
strapush Structure
Application Interface
considerations when porting from SunOS 4 to SunOS 5
Porting to the SunOS 5 System
data path
Stream as a Data Path
data transfer
Opening a Stream
definition
What Is STREAMS?
definition of functionality
What Is STREAMS?
determining when to use
When to Use STREAMS
device driver
STREAMS Device Driver
driver
Structure of a STREAMS Device Driver
flow control
Controlling Data Flow
Message Transfer Flow Control
frequently asked IP interface questions
STREAMS FAQ
hardened
Multithread Module with Outer Perimeter
Multithreaded, Loadable, STREAMS Pseudo-Driver
Simple Line Printer Driver
hardening advice
M_COPYOUT
ioctl Processing
head
Creating the Stream Head
Stream Head
interface
STREAMS Application-Level Components
kernel-level
How STREAMS Works at the Kernel Level
message components
Message Components
message data structures
Message Components
message queue priority
Message Queueing Priority
message queues
Message Queues
message types
Message Components
messages
STREAMS Data
module
Message Processing
STREAMS Module
module multiplexing
Configuring Multiplexed Streams
multiplexing
STREAMS Multiplexers
STREAMS Multiplexing
multithread framework
MT STREAMS Framework
multithread framework integrity
STREAMS Framework Integrity
opening a device
Opening a Stream
polling
STREAMS Polling
programming model
What Is STREAMS?
queue overview
Structure of a Message Queue
tunable parameters
Tunable Parameters
STREAMS administration modules
Application Interface
autopush
facility
Application Interface
STREAMS Administrative Driver
strapush Structure
Application Interface
Application Interface
Application Interface
STREAMS anchors client
example
STREAMS Anchors fd_server.c
STREAMS anchors server
example
STREAMS Anchors fd_server.c
streams control
streamio
ioctl
commands
Other ioctl Commands
STREAMS debugging
STREAMS Error and Trace Logging
error and trace logging
STREAMS Error and Trace Logging
STREAMS Error and Trace Logging
Administration Tool Description
kernel debug printing
Kernel Debug Printing
kernel examination tools
Kernel Examination Tools
STREAMS driver
cloning
Cloning STREAMS Drivers
configuration
Configuring STREAMS Drivers and Modules
configuration entry point
STREAMS Configuration Entry Points
Kernel Contact Points
design guidelines
Summarizing STREAMS Device Drivers
driver interrupt
Kernel Contact Points
Ethernet drivers
STREAMS FAQ
flush handling
Driver Flush Handling
initialization entry point
STREAMS Initialization Entry Points
interrupt handler
STREAMS Interrupt Handlers
ioctl
ioctl Processing
Module and Driver ioctl Calls
loop-around
Loop-Around Driver
porting to multithreaded kernel
Preparing to Port
pseudo-tty
Pseudo-TTY Drivers: ptm and pts
Master Driver and Slave Driver Characteristics
pseudo-tty subsystem master
STREAMS-based Pseudo-Terminal Subsystem
pseudo-tty subsystem slave
STREAMS-based Pseudo-Terminal Subsystem
queue processing entry point
STREAMS Queue Processing Entry Points
Kernel Contact Points
table-driven entry point
STREAMS Table-Driven Entry Points
STREAMS module
Flushing a Queue
Module Overview
adding an anchor
Using Anchors
anchor lock
STREAMS Anchors
autopush facility
Autopush Facility
autopush
facility
strapush Structure
STREAMS Administrative Driver
connld
Unique Connections
design guidelines
Design Guidelines
filter
Filter Module Example
flow control
Design Guidelines
Data Flow Control
ioctl
Module and Driver ioctl Calls
line discipline
Line-Discipline Module
ptem
Pseudo-TTY Emulation Module: ptem
read-side
put
procedure
Module Procedures
routines
STREAMS Module Service Procedure
Module Procedures
service interface example
Service Interface protoput Procedure
Module Service Interface Example
service procedure example
STREAMS Module Service Procedure
service
procedure
Write-side put Procedure
write-side
put
procedure
Read-side put Procedure
STREAMS queue
qband structure
qband Structure
using qband information
Using qband Information
using queue information
Using qband Information
STREAMS-based pipe
STREAMS-based pipe
atomic
write
Atomic Writes
basic operations
Closing a Pipe or FIFO
definition
Overview of Pipes and FIFOs
PIPE_BUF
Atomic Writes
STREAMS-based pseudo-terminal subsystem (
see
pseudo-tty subsystem)
STREAMS-based Pseudo-Terminal Subsystem
STREAMS-based terminal subsystem (
see
tty subsystem)
Overview of Terminal Subsystem
streamtab structure
driver entry point
STREAMS Driver Entry Points
example
Module Structures
pointers to structures for inititializing reading and writng a module
streamtab
strerr
strerr Daemon
strioctl structure
strioctl Structure
example
I_STR ioctl Processing
ic_cmd
strioctl Structure
ic_dp
strioctl Structure
ic_len
strioctl Structure
ic_timout
strioctl Structure
strlog
Kernel Utility Interfaces
strlog Command
flag parameter
strlog Command
STRMSGSZ
tunable parameter
Tunable Parameters
stropts.h
strbuf
Send and Receive Messages
strqget
Kernel Utility Interfaces
Using Queue Information
strqget Command
strqset
Kernel Utility Interfaces
Using Queue Information
strqset Command
structure for
M_IOCTL
unrecognized message
example
General ioctl Processing
structure for nontransparent
ioctl
example
I_STR ioctl Processing
synchronous input/output
in polling
Synchronous Input and Output
system crash
Shared Data Block
Previous
Next