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
|
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
.TH "<stropts.h>" P 2003 POSIX
.\" <stropts.h>
.SH NAME
stropts.h \- STREAMS interface (\fBSTREAMS\fP)
.SH SYNOPSIS
.LP
\fB#include <stropts.h> \fP
.SH DESCRIPTION
.LP
The \fI<stropts.h>\fP header shall define the \fBbandinfo\fP structure
that includes at least the following members:
.sp
.RS
.nf
\fBunsigned char bi_pri \fP Priority band. \fB
int bi_flag \fP Flushing type. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstrpeek\fP structure
that includes at least the following members:
.sp
.RS
.nf
\fBstruct strbuf ctlbuf \fP The control portion of the message. \fB
struct strbuf databuf \fP The data portion of the message. \fB
t_uscalar_t flags \fP RS_HIPRI or 0. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstrbuf\fP structure
that includes at least the following members:
.sp
.RS
.nf
\fBint maxlen \fP Maximum buffer length. \fB
int len \fP Length of data. \fB
char *buf \fP Pointer to buffer. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstrfdinsert\fP structure
that includes at least the following
members:
.sp
.RS
.nf
\fBstruct strbuf ctlbuf \fP The control portion of the message. \fB
struct strbuf databuf \fP The data portion of the message. \fB
t_uscalar_t flags \fP RS_HIPRI or 0. \fB
int fildes \fP File descriptor of the other STREAM. \fB
int offset \fP Relative location of the stored value. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstrioctl\fP structure
that includes at least the following members:
.sp
.RS
.nf
\fBint ic_cmd \fP \fIioctl\fP() command. \fB
int ic_timout \fP Timeout for response. \fB
int ic_len \fP Length of data. \fB
char *ic_dp \fP Pointer to buffer. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstrrecvfd\fP structure
that includes at least the following
members:
.sp
.RS
.nf
\fBint fda \fP Received file descriptor. \fB
uid_t uid \fP UID of sender. \fB
gid_t gid \fP GID of sender. \fB
\fP
.fi
.RE
.LP
The \fBuid_t\fP and \fBgid_t\fP types shall be defined through \fBtypedef\fP
as described in \fI<sys/types.h>\fP .
.LP
The \fI<stropts.h>\fP header shall define the \fBt_scalar_t\fP and
\fBt_uscalar_t\fP types, respectively, as signed and
unsigned opaque types of equal length of at least 32 bits.
.LP
The \fI<stropts.h>\fP header shall define the \fBstr_list\fP structure
that includes at least the following members:
.sp
.RS
.nf
\fBint sl_nmods \fP Number of STREAMS module names. \fB
struct str_mlist *sl_modlist \fP STREAMS module names. \fB
\fP
.fi
.RE
.LP
The \fI<stropts.h>\fP header shall define the \fBstr_mlist\fP structure
that includes at least the following member:
.sp
.RS
.nf
\fBchar l_name[FMNAMESZ+1] \fP A STREAMS module name. \fB
\fP
.fi
.RE
.LP
At least the following macros shall be defined for use as the \fIrequest\fP
argument to \fIioctl\fP():
.TP 7
I_PUSH
Push a STREAMS module.
.TP 7
I_POP
Pop a STREAMS module.
.TP 7
I_LOOK
Get the top module name.
.TP 7
I_FLUSH
Flush a STREAM.
.TP 7
I_FLUSHBAND
Flush one band of a STREAM.
.TP 7
I_SETSIG
Ask for notification signals.
.TP 7
I_GETSIG
Retrieve current notification signals.
.TP 7
I_FIND
Look for a STREAMS module.
.TP 7
I_PEEK
Peek at the top message on a STREAM.
.TP 7
I_SRDOPT
Set the read mode.
.TP 7
I_GRDOPT
Get the read mode.
.TP 7
I_NREAD
Size the top message.
.TP 7
I_FDINSERT
Send implementation-defined information about another STREAM.
.TP 7
I_STR
Send a STREAMS \fIioctl\fP().
.TP 7
I_SWROPT
Set the write mode.
.TP 7
I_GWROPT
Get the write mode.
.TP 7
I_SENDFD
Pass a file descriptor through a STREAMS pipe.
.TP 7
I_RECVFD
Get a file descriptor sent via I_SENDFD.
.TP 7
I_LIST
Get all the module names on a STREAM.
.TP 7
I_ATMARK
Is the top message "marked''?
.TP 7
I_CKBAND
See if any messages exist in a band.
.TP 7
I_GETBAND
Get the band of the top message on a STREAM.
.TP 7
I_CANPUT
Is a band writable?
.TP 7
I_SETCLTIME
Set close time delay.
.TP 7
I_GETCLTIME
Get close time delay.
.TP 7
I_LINK
Connect two STREAMs.
.TP 7
I_UNLINK
Disconnect two STREAMs.
.TP 7
I_PLINK
Persistently connect two STREAMs.
.TP 7
I_PUNLINK
Dismantle a persistent STREAMS link.
.sp
.LP
At least the following macros shall be defined for use with I_LOOK:
.TP 7
FMNAMESZ
The minimum size in bytes of the buffer referred to by the \fIarg\fP
argument.
.sp
.LP
At least the following macros shall be defined for use with I_FLUSH:
.TP 7
FLUSHR
Flush read queues.
.TP 7
FLUSHW
Flush write queues.
.TP 7
FLUSHRW
Flush read and write queues.
.sp
.LP
At least the following macros shall be defined for use with I_SETSIG:
.TP 7
S_RDNORM
A normal (priority band set to 0) message has arrived at the head
of a STREAM head read queue.
.TP 7
S_RDBAND
A message with a non-zero priority band has arrived at the head of
a STREAM head read queue.
.TP 7
S_INPUT
A message, other than a high-priority message, has arrived at the
head of a STREAM head read queue.
.TP 7
S_HIPRI
A high-priority message is present on a STREAM head read queue.
.TP 7
S_OUTPUT
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.
.TP 7
S_WRNORM
Equivalent to S_OUTPUT.
.TP 7
S_WRBAND
The write queue for a non-zero priority band just below the STREAM
head is no longer full.
.TP 7
S_MSG
A STREAMS signal message that contains the SIGPOLL signal reaches
the front of the STREAM head read queue.
.TP 7
S_ERROR
Notification of an error condition reaches the STREAM head.
.TP 7
S_HANGUP
Notification of a hangup reaches the STREAM head.
.TP 7
S_BANDURG
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.
.sp
.LP
At least the following macros shall be defined for use with I_PEEK:
.TP 7
RS_HIPRI
Only look for high-priority messages.
.sp
.LP
At least the following macros shall be defined for use with I_SRDOPT:
.TP 7
RNORM
Byte-STREAM mode, the default.
.TP 7
RMSGD
Message-discard mode.
.TP 7
RMSGN
Message-non-discard mode.
.TP 7
RPROTNORM
Fail \fIread\fP() with [EBADMSG] if a message containing a control
part is at the front
of the STREAM head read queue.
.TP 7
RPROTDAT
Deliver the control part of a message as data when a process issues
a \fIread\fP().
.TP 7
RPROTDIS
Discard the control part of a message, delivering any data part, when
a process issues a \fIread\fP().
.sp
.LP
At least the following macros shall be defined for use with I_SWOPT:
.TP 7
SNDZERO
Send a zero-length message downstream when a \fIwrite\fP() of 0 bytes
occurs.
.sp
.LP
At least the following macros shall be defined for use with I_ATMARK:
.TP 7
ANYMARK
Check if the message is marked.
.TP 7
LASTMARK
Check if the message is the last one marked on the queue.
.sp
.LP
At least the following macros shall be defined for use with I_UNLINK:
.TP 7
MUXID_ALL
Unlink all STREAMs linked to the STREAM associated with \fIfildes\fP.
.sp
.LP
The following macros shall be defined for \fIgetmsg\fP(), \fIgetpmsg\fP(),
\fIputmsg\fP(), and \fIputpmsg\fP():
.TP 7
MSG_ANY
Receive any message.
.TP 7
MSG_BAND
Receive message from specified band.
.TP 7
MSG_HIPRI
Send/receive high-priority message.
.TP 7
MORECTL
More control information is left in message.
.TP 7
MOREDATA
More data is left in message.
.sp
.LP
The \fI<stropts.h>\fP header may make visible all of the symbols from
\fI<unistd.h>\fP.
.LP
The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided.
.sp
.RS
.nf
\fBint 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 *);
\fP
.fi
.RE
.LP
\fIThe following sections are informative.\fP
.SH APPLICATION USAGE
.LP
None.
.SH RATIONALE
.LP
None.
.SH FUTURE DIRECTIONS
.LP
None.
.SH SEE ALSO
.LP
\fI<sys/types.h>\fP , \fI<unistd.h>\fP , the System
Interfaces volume of IEEE\ Std\ 1003.1-2001, \fIclose\fP(), \fIfcntl\fP(),
\fIgetmsg\fP(), \fIioctl\fP(), \fIopen\fP(), \fIpipe\fP(), \fIread\fP(),
\fIpoll\fP(), \fIputmsg\fP(), \fIsignal\fP(), \fIwrite\fP()
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 6, Copyright (C) 2001-2003 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 .
|