1stropts.h(0P) POSIX Programmer's Manual stropts.h(0P)
2
3
4
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
12 stropts.h — STREAMS interface (STREAMS)
13
15 #include <stropts.h>
16
18 The <stropts.h> header shall define the bandinfo structure, which shall
19 include at least the following members:
20
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
29 struct strbuf ctlbuf The control portion of the message.
30 struct strbuf databuf The data portion of the message.
31 t_uscalar_t flags RS_HIPRI or 0.
32
33 The <stropts.h> header shall define the strbuf structure, which shall
34 include at least the following members:
35
36
37 char *buf Pointer to buffer.
38 int len Length of data.
39 int maxlen Maximum buffer length.
40
41 The <stropts.h> header shall define the strfdinsert structure, which
42 shall include at least the following members:
43
44
45 struct strbuf ctlbuf The control portion of the message.
46 struct strbuf databuf The data portion of the message.
47 int fildes File descriptor of the other STREAM.
48 t_uscalar_t flags RS_HIPRI or 0.
49 int offset Relative location of the stored value.
50
51 The <stropts.h> header shall define the strioctl structure, which shall
52 include at least the following members:
53
54
55 int ic_cmd ioctl() command.
56 char *ic_dp Pointer to buffer.
57 int ic_len Length of data.
58 int ic_timout Timeout for response.
59
60 The <stropts.h> header shall define the strrecvfd structure, which
61 shall include at least the following members:
62
63
64 int fd Received file descriptor.
65 gid_t gid GID of sender.
66 uid_t uid UID of sender.
67
68 The <stropts.h> header shall define the uid_t and gid_t types through
69 typedef, as described in <sys/types.h>.
70
71 The <stropts.h> header shall define the t_scalar_t and t_uscalar_t
72 types, respectively, as signed and unsigned opaque types of equal
73 length of at least 32 bits.
74
75 The <stropts.h> header shall define the str_list structure, which shall
76 include at least the following members:
77
78
79 struct str_mlist *sl_modlist STREAMS module names.
80 int sl_nmods Number of STREAMS module names.
81
82 The <stropts.h> header shall define the str_mlist structure, which
83 shall include at least the following member:
84
85
86 char l_name[FMNAMESZ+1] A STREAMS module name.
87
88 The <stropts.h> header shall define at least the following symbolic
89 constants for use as the request argument to ioctl():
90
91 I_ATMARK Is the top message ``marked''?
92
93 I_CANPUT Is a band writable?
94
95 I_CKBAND See if any messages exist in a band.
96
97 I_FDINSERT Send implementation-defined information about another
98 STREAM.
99
100 I_FIND Look for a STREAMS module.
101
102 I_FLUSH Flush a STREAM.
103
104 I_FLUSHBAND Flush one band of a STREAM.
105
106 I_GETBAND Get the band of the top message on a STREAM.
107
108 I_GETCLTIME Get close time delay.
109
110 I_GETSIG Retrieve current notification signals.
111
112 I_GRDOPT Get the read mode.
113
114 I_GWROPT Get the write mode.
115
116 I_LINK Connect two STREAMs.
117
118 I_LIST Get all the module names on a STREAM.
119
120 I_LOOK Get the top module name.
121
122 I_NREAD Size the top message.
123
124 I_PEEK Peek at the top message on a STREAM.
125
126 I_PLINK Persistently connect two STREAMs.
127
128 I_POP Pop a STREAMS module.
129
130 I_PUNLINK Dismantle a persistent STREAMS link.
131
132 I_PUSH Push a STREAMS module.
133
134 I_RECVFD Get a file descriptor sent via I_SENDFD.
135
136 I_SENDFD Pass a file descriptor through a STREAMS pipe.
137
138 I_SETCLTIME Set close time delay.
139
140 I_SETSIG Ask for notification signals.
141
142 I_SRDOPT Set the read mode.
143
144 I_STR Send a STREAMS ioctl().
145
146 I_SWROPT Set the write mode.
147
148 I_UNLINK Disconnect two STREAMs.
149
150 The <stropts.h> header shall define at least the following symbolic
151 constant for use with I_LOOK:
152
153 FMNAMESZ The minimum size in bytes of the buffer referred to by the
154 arg argument.
155
156 The <stropts.h> header shall define at least the following symbolic
157 constants for use with I_FLUSH:
158
159 FLUSHR Flush read queues.
160
161 FLUSHRW Flush read and write queues.
162
163 FLUSHW Flush write queues.
164
165 The <stropts.h> header shall define at least the following symbolic
166 constants for use with I_SETSIG:
167
168 S_BANDURG When used in conjunction with S_RDBAND, SIGURG is generated
169 instead of SIGPOLL when a priority message reaches the
170 front of the STREAM head read queue.
171
172 S_ERROR Notification of an error condition reaches the STREAM head.
173
174 S_HANGUP Notification of a hangup reaches the STREAM head.
175
176 S_HIPRI A high-priority message is present on a STREAM head read
177 queue.
178
179 S_INPUT A message, other than a high-priority message, has arrived
180 at the head of a STREAM head read queue.
181
182 S_MSG A STREAMS signal message that contains the SIGPOLL signal
183 reaches the front of the STREAM head read queue.
184
185 S_OUTPUT The write queue for normal data (priority band 0) just
186 below the STREAM head is no longer full. This notifies the
187 process that there is room on the queue for sending (or
188 writing) normal data downstream.
189
190 S_RDBAND A message with a non-zero priority band has arrived at the
191 head of a STREAM head read queue.
192
193 S_RDNORM A normal (priority band set to 0) message has arrived at
194 the head of a STREAM head read queue.
195
196 S_WRBAND The write queue for a non-zero priority band just below the
197 STREAM head is no longer full.
198
199 S_WRNORM Equivalent to S_OUTPUT.
200
201 The <stropts.h> header shall define at least the following symbolic
202 constant for use with I_PEEK:
203
204 RS_HIPRI Only look for high-priority messages.
205
206 The <stropts.h> header shall define at least the following symbolic
207 constants for use with I_SRDOPT:
208
209 RMSGD Message-discard mode.
210
211 RMSGN Message-non-discard mode.
212
213 RNORM Byte-STREAM mode, the default.
214
215 RPROTDAT Deliver the control part of a message as data when a
216 process issues a read().
217
218 RPROTDIS Discard the control part of a message, delivering any data
219 part, when a process issues a read().
220
221 RPROTNORM Fail read() with [EBADMSG] if a message containing a con‐
222 trol part is at the front of the STREAM head read queue.
223
224 The <stropts.h> header shall define at least the following symbolic
225 constant for use with I_SWOPT:
226
227 SNDZERO Send a zero-length message downstream when a write() of 0
228 bytes occurs.
229
230 The <stropts.h> header shall define at least the following symbolic
231 constants for use with I_ATMARK:
232
233 ANYMARK Check if the message is marked.
234
235 LASTMARK Check if the message is the last one marked on the queue.
236
237 The <stropts.h> header shall define at least the following symbolic
238 constant for use with I_UNLINK:
239
240 MUXID_ALL Unlink all STREAMs linked to the STREAM associated with
241 fildes.
242
243 The <stropts.h> header shall define the following symbolic constants
244 for getmsg(), getpmsg(), putmsg(), and putpmsg():
245
246 MORECTL More control information is left in message.
247
248 MOREDATA More data is left in message.
249
250 MSG_ANY Receive any message.
251
252 MSG_BAND Receive message from specified band.
253
254 MSG_HIPRI Send/receive high-priority message.
255
256 The <stropts.h> header may make visible all of the symbols from
257 <unistd.h>.
258
259 The <stropts.h> header may also define macros for message types using
260 names that start with M_.
261
262 The following shall be declared as functions and may also be defined as
263 macros. Function prototypes shall be provided.
264
265
266 int fattach(int, const char *);
267 int fdetach(const char *);
268 int getmsg(int, struct strbuf *restrict, struct strbuf *restrict,
269 int *restrict);
270 int getpmsg(int, struct strbuf *restrict, struct strbuf *restrict,
271 int *restrict, int *restrict);
272 int ioctl(int, int, ...);
273 int isastream(int);
274 int putmsg(int, const struct strbuf *, const struct strbuf *, int);
275 int putpmsg(int, const struct strbuf *, const struct strbuf *, int,
276 int);
277
278 The following sections are informative.
279
281 None.
282
284 None.
285
287 None.
288
290 <sys_types.h>, <unistd.h>
291
292 The System Interfaces volume of POSIX.1‐2017, close(), fattach(),
293 fcntl(), fdetach(), getmsg(), ioctl(), isastream(), open(), pipe(),
294 read(), poll(), putmsg(), signal(), write()
295
297 Portions of this text are reprinted and reproduced in electronic form
298 from IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
299 table Operating System Interface (POSIX), The Open Group Base Specifi‐
300 cations Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of
301 Electrical and Electronics Engineers, Inc and The Open Group. In the
302 event of any discrepancy between this version and the original IEEE and
303 The Open Group Standard, the original IEEE and The Open Group Standard
304 is the referee document. The original Standard can be obtained online
305 at http://www.opengroup.org/unix/online.html .
306
307 Any typographical or formatting errors that appear in this page are
308 most likely to have been introduced during the conversion of the source
309 files to man page format. To report such errors, see https://www.ker‐
310 nel.org/doc/man-pages/reporting_bugs.html .
311
312
313
314IEEE/The Open Group 2017 stropts.h(0P)