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