summaryrefslogtreecommitdiffstats
path: root/man-pages-posix-2017/man0p/stropts.h.0p
blob: b06aac39af8ef0519e6e18fc432d4b7359a0d6c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
'\" et
.TH stropts.h "0P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.\"
.SH NAME
stropts.h
\(em STREAMS interface (\fBSTREAMS\fP)
.SH SYNOPSIS
.LP
.nf
#include <stropts.h>
.fi
.SH DESCRIPTION
The
.IR <stropts.h> 
header shall define the
.BR bandinfo
structure, which shall include at least the following members:
.sp
.RS 4
.nf

int            bi_flag  \fRFlushing type.\fR
unsigned char  bi_pri   \fRPriority band.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR strpeek
structure, which shall include at least the following members:
.sp
.RS 4
.nf

struct strbuf  ctlbuf   \fRThe control portion of the message.\fR
struct strbuf  databuf  \fRThe data portion of the message.\fR
t_uscalar_t    flags    \fRRS_HIPRI or 0.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR strbuf
structure, which shall include at least the following members:
.sp
.RS 4
.nf

char  *buf     \fRPointer to buffer.\fP
int    len     \fRLength of data.\fP
int    maxlen  \fRMaximum buffer length.\fP
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR strfdinsert
structure, which shall include at least the following members:
.sp
.RS 4
.nf

struct strbuf  ctlbuf   \fRThe control portion of the message.\fR
struct strbuf  databuf  \fRThe data portion of the message.\fR
int            fildes   \fRFile descriptor of the other STREAM.\fR
t_uscalar_t    flags    \fRRS_HIPRI or 0.\fR
int            offset   \fRRelative location of the stored value.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR strioctl
structure, which shall include at least the following members:
.sp
.RS 4
.nf

int    ic_cmd     \fIioctl\fR(\|) command.\fR
char  *ic_dp      \fRPointer to buffer.\fR
int    ic_len     \fRLength of data.\fR
int    ic_timout  \fRTimeout for response.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR strrecvfd
structure, which shall include at least the following members:
.sp
.RS 4
.nf

int    fd   \fRReceived file descriptor.\fR
gid_t  gid  \fRGID of sender.\fR
uid_t  uid  \fRUID of sender.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR uid_t
and
.BR gid_t
types through
.BR typedef ,
as described in
.IR <sys/types.h> .
.P
The
.IR <stropts.h> 
header shall define the
.BR t_scalar_t
and
.BR t_uscalar_t
types, respectively, as signed and unsigned opaque types of equal
length of at least 32 bits.
.P
The
.IR <stropts.h> 
header shall define the
.BR str_list
structure, which shall include at least the following members:
.sp
.RS 4
.nf

struct str_mlist  *sl_modlist  \fRSTREAMS module names.\fR
int                sl_nmods    \fRNumber of STREAMS module names.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define the
.BR str_mlist
structure, which shall include at least the following member:
.sp
.RS 4
.nf

char  l_name[FMNAMESZ+1]  \fRA STREAMS module name.\fR
.fi
.P
.RE
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constants for use
as the
.IR request
argument to
\fIioctl\fR():
.IP I_ATMARK 12
Is the top message ``marked''?
.IP I_CANPUT 12
Is a band writable?
.IP I_CKBAND 12
See if any messages exist in a band.
.IP I_FDINSERT 12
Send implementation-defined information about another STREAM.
.IP I_FIND 12
Look for a STREAMS module.
.IP I_FLUSH 12
Flush a STREAM.
.IP I_FLUSHBAND 12
Flush one band of a STREAM.
.IP I_GETBAND 12
Get the band of the top message on a STREAM.
.IP I_GETCLTIME 12
Get close time delay.
.IP I_GETSIG 12
Retrieve current notification signals.
.IP I_GRDOPT 12
Get the read mode.
.IP I_GWROPT 12
Get the write mode.
.IP I_LINK 12
Connect two STREAMs.
.IP I_LIST 12
Get all the module names on a STREAM.
.IP I_LOOK 12
Get the top module name.
.IP I_NREAD 12
Size the top message.
.IP I_PEEK 12
Peek at the top message on a STREAM.
.IP I_PLINK 12
Persistently connect two STREAMs.
.IP I_POP 12
Pop a STREAMS module.
.IP I_PUNLINK 12
Dismantle a persistent STREAMS link.
.IP I_PUSH 12
Push a STREAMS module.
.IP I_RECVFD 12
Get a file descriptor sent via I_SENDFD.
.IP I_SENDFD 12
Pass a file descriptor through a STREAMS pipe.
.IP I_SETCLTIME 12
Set close time delay.
.IP I_SETSIG 12
Ask for notification signals.
.IP I_SRDOPT 12
Set the read mode.
.IP I_STR 12
Send a STREAMS
\fIioctl\fR().
.IP I_SWROPT 12
Set the write mode.
.IP I_UNLINK 12
Disconnect two STREAMs.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constant for use
with I_LOOK:
.IP FMNAMESZ 12
The minimum size in bytes of the buffer referred to by the
.IR arg
argument.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constants for use
with I_FLUSH:
.IP FLUSHR 12
Flush read queues.
.IP FLUSHRW 12
Flush read and write queues.
.IP FLUSHW 12
Flush write queues.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constants for use
with I_SETSIG:
.IP S_BANDURG 12
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.
.IP S_ERROR 12
Notification of an error condition reaches the STREAM head.
.IP S_HANGUP 12
Notification of a hangup reaches the STREAM head.
.IP S_HIPRI 12
A high-priority message is present on a STREAM head read queue.
.IP S_INPUT 12
A message, other than a high-priority message, has arrived at the head
of a STREAM head read queue.
.IP S_MSG 12
A STREAMS signal message that contains the SIGPOLL signal reaches the
front of the STREAM head read queue.
.IP S_OUTPUT 12
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.
.IP S_RDBAND 12
A message with a non-zero priority band has arrived at the head of a
STREAM head read queue.
.IP S_RDNORM 12
A normal (priority band set to 0) message has arrived at the head of a
STREAM head read queue.
.IP S_WRBAND 12
The write queue for a non-zero priority band just below the STREAM head
is no longer full.
.IP S_WRNORM 12
Equivalent to S_OUTPUT.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constant for use
with I_PEEK:
.IP RS_HIPRI 12
Only look for high-priority messages.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constants for use
with I_SRDOPT:
.IP RMSGD 12
Message-discard mode.
.IP RMSGN 12
Message-non-discard mode.
.IP RNORM 12
Byte-STREAM mode, the default.
.IP RPROTDAT 12
Deliver the control part of a message as data when a process issues a
\fIread\fR().
.IP RPROTDIS 12
Discard the control part of a message, delivering any data part, when a
process issues a
\fIread\fR().
.IP RPROTNORM 12
Fail
\fIread\fR()
with
.BR [EBADMSG] 
if a message containing a control part is at the front of the STREAM
head read queue.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constant for use
with I_SWOPT:
.IP SNDZERO 12
Send a zero-length message downstream when a
\fIwrite\fR()
of 0 bytes occurs.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constants for use
with I_ATMARK:
.IP ANYMARK 12
Check if the message is marked.
.IP LASTMARK 12
Check if the message is the last one marked on the queue.
.P
The
.IR <stropts.h> 
header shall define at least the following symbolic constant for use
with I_UNLINK:
.IP MUXID_ALL 12
Unlink all STREAMs linked to the STREAM associated with
.IR fildes .
.P
The
.IR <stropts.h> 
header shall define the following symbolic constants for
\fIgetmsg\fR(),
\fIgetpmsg\fR(),
\fIputmsg\fR(),
and
\fIputpmsg\fR():
.IP MORECTL 12
More control information is left in message.
.IP MOREDATA 12
More data is left in message.
.IP MSG_ANY 12
Receive any message.
.IP MSG_BAND 12
Receive message from specified band.
.IP MSG_HIPRI 12
Send/receive high-priority message.
.P
The
.IR <stropts.h> 
header may make visible all of the symbols from
.IR <unistd.h> .
.P
The
.IR <stropts.h> 
header may also define macros for message types using names that
start with
.IR M_ .
.P
The following shall be declared as functions and may also be defined as
macros. Function prototypes shall be provided.
.sp
.RS 4
.nf

int    fattach(int, const char *);
int    fdetach(const char *);
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    isastream(int);
int    putmsg(int, const struct strbuf *, const struct strbuf *, int);
int    putpmsg(int, const struct strbuf *, const struct strbuf *, int,
           int);
.fi
.P
.RE
.LP
.IR "The following sections are informative."
.SH "APPLICATION USAGE"
None.
.SH RATIONALE
None.
.SH "FUTURE DIRECTIONS"
None.
.SH "SEE ALSO"
.IR "\fB<sys_types.h>\fP",
.IR "\fB<unistd.h>\fP"
.P
The System Interfaces volume of POSIX.1\(hy2017,
.IR "\fIclose\fR\^(\|)",
.IR "\fIfattach\fR\^(\|)",
.IR "\fIfcntl\fR\^(\|)",
.IR "\fIfdetach\fR\^(\|)",
.IR "\fIgetmsg\fR\^(\|)",
.IR "\fIioctl\fR\^(\|)",
.IR "\fIisastream\fR\^(\|)",
.IR "\fIopen\fR\^(\|)",
.IR "\fIpipe\fR\^(\|)",
.IR "\fIread\fR\^(\|)",
.IR "\fIpoll\fR\^(\|)",
.IR "\fIputmsg\fR\^(\|)",
.IR "\fIsignal\fR\^(\|)",
.IR "\fIwrite\fR\^(\|)"
.\"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1-2017, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, 2018 Edition,
Copyright (C) 2018 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
In the event of any discrepancy between this version 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 .
.PP
Any typographical or formatting errors that appear
in this page are most likely
to have been introduced during the conversion of the source files to
man page format. To report such errors, see
https://www.kernel.org/doc/man-pages/reporting_bugs.html .