Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved. Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
http://www.opengroup.org/bookstore/.
The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
This notice shall appear on any product containing this material.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
#include <stropts.h>
The <stropts.h> header defines the bandinfo structure, which includes the following members:
unsigned char bi_pri /* priority band */ int bi_flag /* flushing type */
The <stropts.h> header defines the strpeek structure that includes the following members:
struct strbuf ctlbuf /* control portion of the message */ struct strbuf databuf /* data portion of the message */ t_uscalar_t flags /* RS_HIPRI or 0 */
The <stropts.h> header defines the strbuf structure that includes the following members:
int maxlen /* maximum buffer length */ int len /* length of data */ char *buf /* pointer to buffer */
The <stropts.h> header defines the strfdinsert structure that includes the following members:
struct strbuf ctlbuf /* control portion of the message */ struct strbuf databuf /* data portion of the message */ t_uscalar_t flags /* RS_HIPRI or 0 */ int fildes /* file descriptor of the other stream */ int offset /* relative location of the stored value */
The <stropts.h> header defines the strioctl structure that includes the following members:
int ic_cmd /* ioctl() command */ int ic_timout /* timeout for response */ int ic_len /* length of data */ char *ic_dp /* pointer to buffer */
The <stropts.h> header defines the strrecvfd structure that includes the following members:
int fda /* received file descriptor */ uid_t uid /* UID of sender */ gid_t gid /* GID of sender */
The uid_t and gid_t types are defined through typedef as described in <sys/types.h>. See types.h(3HEAD).
The <stropts.h> header defines the t_scalar_t and t_uscalar_t types, respectively, as signed and unsigned opaque types of equal length of at least 32 bits.
The <stropts.h> header defines the str_list structure that includes the following members:
int sl_nmods /* number of STREAMS module names */ struct str_mlist *sl_modlist /* STREAMS module names */
The <stropts.h> header defines the str_mlist structure that includes the following member: char l_name[FMNAMESZ+1]
a STREAMS module name
The following macros are defined for use as the request argument to ioctl(): I_PUSH
Push a STREAMS module.
Pop a STREAMS module.
Get the top module name.
Flush a stream.
Flush one band of a stream.
Ask for notification signals.
Retrieve current notification signals.
Look for a STREAMS module.
Peek at the top message on a stream.
Set the read mode.
Get the read mode.
Size the top message.
Send implementation-defined information about another stream.
Send a STREAMS ioctl().
Set the write mode.
Get the write mode.
Pass a file descriptor through a STREAMS pipe.
Get a file descriptor sent via I_SENDFD.
Get all the module names on a stream.
Is the top message ``marked''?
See if any messages exist in a band.
Get the band of the top message on a stream.
Is a band writable?
Set close time delay.
Get close time delay.
Connect two streams.
Disconnect two streams.
Persistently connect two streams.
Dismantle a persistent STREAMS link.
The following macro is defined for use with I_LOOK: FMNAMESZ
minimum size in bytes of the buffer referred to by the arg argument
The following macros are defined for use with I_FLUSH: FLUSHR
flush read queues
flush write queues
flush read and write queues
The following macros are defined for use with I_SETSIG: S_RDNORM
A normal (priority band set to 0) message has arrived at the head of a stream head read queue.
A message with a non-zero priority band has arrived at the head of a stream head read queue.
A message, other than a high-priority message, has arrived at the head of a stream head read queue.
A high-priority message is present on a stream head read queue.
The write queue for normal data (priority band 0) just below the stream head is no longer full. This notifies the process that there is room on the queue for sending (or writing) normal data downstream.
Equivalent to S_OUTPUT.
The write queue for a non-zero priority band just below the stream head is no longer full.
A STREAMS signal message that contains the SIGPOLL signal reaches the front of the stream head read queue.
Notification of an error condition reaches the stream head.
Notification of a hangup reaches the stream head.
When used in conjunction with S_RDBAND, SIGURG is generated instead of SIGPOLL when a priority message reaches the front of the stream head read queue.
The following macro is defined for use with I_PEEK: RS_HIPRI
Only look for high-priority messages.
The following macros are defined for use with I_SRDOPT: RNORM
Byte-stream mode, the default.
Message-discard mode.
Message-non-discard mode.
Fail read() with [EBADMSG] if a message containing a control part is at the front of the stream head read queue.
Deliver the control part of a message as data when a process issues a read()
Discard the control part of a message, delivering any data part, when a process issues a read()
The following macro is defined for use with I_SWOPT: SNDZERO
Send a zero-length message downstream when a write() of 0 bytes occurs.
The following macros are defined for use with I_ATMARK: ANYMARK
Check if the message is marked.
Check if the message is the last one marked on the queue.
The following macro is defined for use with I_UNLINK: MUXID_ALL
Unlink all stream linked to the stream associated with fildes.
The following macros are defined for getmsg(), getpmsg(), putmsg(), and putpmsg(): MSG_ANY
Receive any message.
Receive message from specified band.
More control information is left in message.
More data is left in message.
The <stropts.h> header can make visible all of the symbols from <unistd.h>.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Standard |
close(2), fcntl(2), getmsg(2), ioctl(2), open(2), pipe(2), poll(2), putmsg(2), read(2), write(2), signal(3C), types.h(3HEAD), unistd.h(3HEAD), attributes(5), standards(5)