STROPTS.H(7) Miscellaneous Information Manual STROPTS.H(7)

stropts.hSTREAMS interface (STREAMS)


#include <stropts.h>

The <stropts.h> header shall define the structure that includes at least the following members:

unsigned char  bi_pri   Priority band.
int            bi_flag  Flushing type.

The <stropts.h> header shall define the strpeek structure that includes at least the following members:

struct strbuf  ctlbuf   The control portion of the message.
struct strbuf  databuf  The data portion of the message.
t_uscalar_t    flags    RS_HIPRI or 0.

The <stropts.h> header shall define the structure that includes at least the following members:

int    maxlen  Maximum buffer length.
int    len     Length of data.
char  *buf     Pointer to buffer.

The <stropts.h> header shall define the strfdinsert structure that includes at least the following members:

struct strbuf  ctlbuf   The control portion of the message.
struct strbuf  databuf  The 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 shall define the structure that includes at least 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 shall define the structure that includes at least the following members:

int    fda  Received file descriptor.
uid_t  uid  UID of sender.
gid_t  gid  GID of sender.

The and types shall be defined through as described in <sys/types.h> .

The <stropts.h> header shall define the and t_uscalar_t types, respectively, as signed and unsigned opaque types of equal length of at least 32 bits.

The <stropts.h> header shall define the structure that includes at least the following members:

int                sl_nmods    Number of STREAMS module names.
struct str_mlist  *sl_modlist  STREAMS module names.

The <stropts.h> header shall define the structure that includes at least the following member:

char  l_name[FMNAMESZ+1]  A STREAMS module name.

At least the following macros shall be defined for use as the argument to ioctl(3):

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 () .
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.

At least the following macros shall be defined for use with I_LOOK:

The minimum size in bytes of the buffer referred to by the arg argument.

At least the following macros shall be defined for use with I_FLUSH:

Flush read queues.
Flush write queues.
Flush read and write queues.

At least the following macros shall be defined for use with I_SETSIG:

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.

At least the following macros shall be defined for use with I_PEEK:

Only look for high-priority messages.

At least the following macros shall be defined for use with I_SRDOPT:

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 () .

At least the following macros shall be defined for use with I_SWOPT:

Send a zero-length message downstream when a () of 0 bytes occurs.

At least the following macros shall be defined for use with I_ATMARK:

Check if the message is marked.
Check if the message is the last one marked on the queue.

At least the following macros shall be defined for use with I_UNLINK:

Unlink all STREAMs linked to the STREAM associated with fildes .

The following macros shall be defined for getmsg(3), getpmsg(3), putmsg(3), and putpmsg(3):

Receive any message.
Receive message from specified band.
Send/receive high-priority message.
More control information is left in message.
More data is left in message.

The <stropts.h> header may make visible all of the symbols from <unistd.h>.

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.

int    isastream(int);
int    getmsg(int, struct strbuf *restrict, struct strbuf *restrict,
           int *restrict);
int    getpmsg(int, struct strbuf *restrict, struct strbuf *restrict,
           int *restrict, int *restrict);
int    ioctl(int, int, ... );
int    putmsg(int, const struct strbuf *, const struct strbuf *, int);
int    putpmsg(int, const struct strbuf *, const struct strbuf *, int,
           int);
int    fattach(int, const char *);
int    fdetach(const char *);

None.

None.

None.

<sys/types.h> , <unistd.h> , the System Interfaces volume of IEEE Std 1003.1-2001 (“POSIX.1”), close(3), fcntl(3), getmsg(3), ioctl(3), open(3), pipe(3), read(3), poll(3), putmsg(3), signal(3), write(3)

First released in Issue 4, Version 2.

The members of the strpeek and strfdinsert structures are changed from to t_uscalar_t.

This header is marked as part of the XSI STREAMS Option Group.

The keyword is added to the prototypes for getmsg(3) and getpmsg(3).

footer end

December 6, 2001 posix.fail