1stropts.h(0P)              POSIX Programmer's Manual             stropts.h(0P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       stropts.h — STREAMS interface (STREAMS)
14

SYNOPSIS

16       #include <stropts.h>
17

DESCRIPTION

19       The <stropts.h> header shall define the bandinfo structure, which shall
20       include at least the following members:
21
22           int            bi_flag  Flushing type.
23           unsigned char  bi_pri   Priority band.
24
25       The  <stropts.h> header shall define the strpeek structure, which shall
26       include at least the following members:
27
28           struct strbuf  ctlbuf   The control portion of the message.
29           struct strbuf  databuf  The data portion of the message.
30           t_uscalar_t    flags    RS_HIPRI or 0.
31
32       The <stropts.h> header shall define the strbuf structure,  which  shall
33       include at least the following members:
34
35           char  *buf     Pointer to buffer.
36           int    len     Length of data.
37           int    maxlen  Maximum buffer length.
38
39       The  <stropts.h>  header  shall define the strfdinsert structure, which
40       shall include at least the following members:
41
42           struct strbuf  ctlbuf   The control portion of the message.
43           struct strbuf  databuf  The data portion of the message.
44           int            fildes   File descriptor of the other STREAM.
45           t_uscalar_t    flags    RS_HIPRI or 0.
46           int            offset   Relative location of the stored value.
47
48       The <stropts.h> header shall define the strioctl structure, which shall
49       include at least the following members:
50
51           int    ic_cmd     ioctl() command.
52           char  *ic_dp      Pointer to buffer.
53           int    ic_len     Length of data.
54           int    ic_timout  Timeout for response.
55
56       The  <stropts.h>  header  shall  define  the strrecvfd structure, which
57       shall include at least the following members:
58
59           int    fd   Received file descriptor.
60           gid_t  gid  GID of sender.
61           uid_t  uid  UID of sender.
62
63       The <stropts.h> header shall define the uid_t and gid_t  types  through
64       typedef, as described in <sys/types.h>.
65
66       The  <stropts.h>  header  shall  define  the t_scalar_t and t_uscalar_t
67       types, respectively, as signed  and  unsigned  opaque  types  of  equal
68       length of at least 32 bits.
69
70       The <stropts.h> header shall define the str_list structure, which shall
71       include at least the following members:
72
73           struct str_mlist  *sl_modlist  STREAMS module names.
74           int                sl_nmods    Number of STREAMS module names.
75
76       The <stropts.h> header shall  define  the  str_mlist  structure,  which
77       shall include at least the following member:
78
79           char  l_name[FMNAMESZ+1]  A STREAMS module name.
80
81       The  <stropts.h>  header  shall  define at least the following symbolic
82       constants for use as the request argument to ioctl():
83
84       I_ATMARK    Is the top message ``marked''?
85
86       I_CANPUT    Is a band writable?
87
88       I_CKBAND    See if any messages exist in a band.
89
90       I_FDINSERT  Send  implementation-defined  information   about   another
91                   STREAM.
92
93       I_FIND      Look for a STREAMS module.
94
95       I_FLUSH     Flush a STREAM.
96
97       I_FLUSHBAND Flush one band of a STREAM.
98
99       I_GETBAND   Get the band of the top message on a STREAM.
100
101       I_GETCLTIME Get close time delay.
102
103       I_GETSIG    Retrieve current notification signals.
104
105       I_GRDOPT    Get the read mode.
106
107       I_GWROPT    Get the write mode.
108
109       I_LINK      Connect two STREAMs.
110
111       I_LIST      Get all the module names on a STREAM.
112
113       I_LOOK      Get the top module name.
114
115       I_NREAD     Size the top message.
116
117       I_PEEK      Peek at the top message on a STREAM.
118
119       I_PLINK     Persistently connect two STREAMs.
120
121       I_POP       Pop a STREAMS module.
122
123       I_PUNLINK   Dismantle a persistent STREAMS link.
124
125       I_PUSH      Push a STREAMS module.
126
127       I_RECVFD    Get a file descriptor sent via I_SENDFD.
128
129       I_SENDFD    Pass a file descriptor through a STREAMS pipe.
130
131       I_SETCLTIME Set close time delay.
132
133       I_SETSIG    Ask for notification signals.
134
135       I_SRDOPT    Set the read mode.
136
137       I_STR       Send a STREAMS ioctl().
138
139       I_SWROPT    Set the write mode.
140
141       I_UNLINK    Disconnect two STREAMs.
142
143       The  <stropts.h>  header  shall  define at least the following symbolic
144       constant for use with I_LOOK:
145
146       FMNAMESZ    The minimum size in bytes of the buffer referred to by  the
147                   arg argument.
148
149       The  <stropts.h>  header  shall  define at least the following symbolic
150       constants for use with I_FLUSH:
151
152       FLUSHR      Flush read queues.
153
154       FLUSHRW     Flush read and write queues.
155
156       FLUSHW      Flush write queues.
157
158       The <stropts.h> header shall define at  least  the  following  symbolic
159       constants for use with I_SETSIG:
160
161       S_BANDURG   When used in conjunction with S_RDBAND, SIGURG is generated
162                   instead of SIGPOLL when  a  priority  message  reaches  the
163                   front of the STREAM head read queue.
164
165       S_ERROR     Notification of an error condition reaches the STREAM head.
166
167       S_HANGUP    Notification of a hangup reaches the STREAM head.
168
169       S_HIPRI     A  high-priority  message  is present on a STREAM head read
170                   queue.
171
172       S_INPUT     A message, other than a high-priority message, has  arrived
173                   at the head of a STREAM head read queue.
174
175       S_MSG       A  STREAMS  signal message that contains the SIGPOLL signal
176                   reaches the front of the STREAM head read queue.
177
178       S_OUTPUT    The write queue for normal  data  (priority  band  0)  just
179                   below  the STREAM head is no longer full. This notifies the
180                   process that there is room on the  queue  for  sending  (or
181                   writing) normal data downstream.
182
183       S_RDBAND    A  message with a non-zero priority band has arrived at the
184                   head of a STREAM head read queue.
185
186       S_RDNORM    A normal (priority band set to 0) message  has  arrived  at
187                   the head of a STREAM head read queue.
188
189       S_WRBAND    The write queue for a non-zero priority band just below the
190                   STREAM head is no longer full.
191
192       S_WRNORM    Equivalent to S_OUTPUT.
193
194       The <stropts.h> header shall define at  least  the  following  symbolic
195       constant for use with I_PEEK:
196
197       RS_HIPRI    Only look for high-priority messages.
198
199       The  <stropts.h>  header  shall  define at least the following symbolic
200       constants for use with I_SRDOPT:
201
202       RMSGD       Message-discard mode.
203
204       RMSGN       Message-non-discard mode.
205
206       RNORM       Byte-STREAM mode, the default.
207
208       RPROTDAT    Deliver the control part  of  a  message  as  data  when  a
209                   process issues a read().
210
211       RPROTDIS    Discard  the control part of a message, delivering any data
212                   part, when a process issues a read().
213
214       RPROTNORM   Fail read() with [EBADMSG] if a message containing  a  con‐
215                   trol part is at the front of the STREAM head read queue.
216
217       The  <stropts.h>  header  shall  define at least the following symbolic
218       constant for use with I_SWOPT:
219
220       SNDZERO     Send a zero-length message downstream when a write()  of  0
221                   bytes occurs.
222
223       The  <stropts.h>  header  shall  define at least the following symbolic
224       constants for use with I_ATMARK:
225
226       ANYMARK     Check if the message is marked.
227
228       LASTMARK    Check if the message is the last one marked on the queue.
229
230       The <stropts.h> header shall define at  least  the  following  symbolic
231       constant for use with I_UNLINK:
232
233       MUXID_ALL   Unlink  all  STREAMs  linked  to the STREAM associated with
234                   fildes.
235
236       The <stropts.h> header shall define the  following  symbolic  constants
237       for getmsg(), getpmsg(), putmsg(), and putpmsg():
238
239       MORECTL     More control information is left in message.
240
241       MOREDATA    More data is left in message.
242
243       MSG_ANY     Receive any message.
244
245       MSG_BAND    Receive message from specified band.
246
247       MSG_HIPRI   Send/receive high-priority message.
248
249       The  <stropts.h>  header  may  make  visible  all  of  the symbols from
250       <unistd.h>.
251
252       The following shall be declared as functions and may also be defined as
253       macros. Function prototypes shall be provided.
254
255           int    fattach(int, const char *);
256           int    fdetach(const char *);
257           int    getmsg(int, struct strbuf *restrict, struct strbuf *restrict,
258                      int *restrict);
259           int    getpmsg(int, struct strbuf *restrict, struct strbuf *restrict,
260                      int *restrict, int *restrict);
261           int    ioctl(int, int, ...);
262           int    isastream(int);
263           int    putmsg(int, const struct strbuf *, const struct strbuf *, int);
264           int    putpmsg(int, const struct strbuf *, const struct strbuf *, int,
265                      int);
266
267       The following sections are informative.
268

APPLICATION USAGE

270       None.
271

RATIONALE

273       None.
274

FUTURE DIRECTIONS

276       None.
277

SEE ALSO

279       <sys_types.h>, <unistd.h>
280
281       The  System  Interfaces  volume  of  POSIX.1‐2008,  close(), fattach(),
282       fcntl(), fdetach(), getmsg(),  ioctl(),  isastream(),  open(),  pipe(),
283       read(), poll(), putmsg(), signal(), write()
284
286       Portions  of  this text are reprinted and reproduced in electronic form
287       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
288       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
289       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
290       cal  and  Electronics  Engineers,  Inc  and  The  Open Group.  (This is
291       POSIX.1-2008 with the 2013 Technical Corrigendum  1  applied.)  In  the
292       event of any discrepancy between this version and the original IEEE and
293       The Open Group Standard, the original IEEE and The Open Group  Standard
294       is  the  referee document. The original Standard can be obtained online
295       at http://www.unix.org/online.html .
296
297       Any typographical or formatting errors that appear  in  this  page  are
298       most likely to have been introduced during the conversion of the source
299       files to man page format. To report such errors,  see  https://www.ker
300       nel.org/doc/man-pages/reporting_bugs.html .
301
302
303
304IEEE/The Open Group                  2013                        stropts.h(0P)
Impressum