1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man7i / streamio.7i
blob2b7e45629b2b3a303809a7b9489f1769db594104
1 '\" te
2 .\" Copyright (c) 2009, Sun Microsystems, Inc.  All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
5 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
6 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH STREAMIO 7I "Apr 8, 2009"
8 .SH NAME
9 streamio \- STREAMS ioctl commands
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <stropts.h>
15 #include <sys/conf.h>
17 \fBint\fR \fBioctl\fR(\fBint\fR \fIfildes\fR, \fBint\fR \fIcommand\fR, \fB\&... /*arg*/\fR);
18 .fi
20 .SH DESCRIPTION
21 .sp
22 .LP
23 STREAMS (see \fBIntro\fR(3)) \fBioctl\fR commands are a subset of the
24 \fBioctl\fR(2) commands and perform a variety of control functions on streams.
25 .sp
26 .LP
27 The \fIfildes\fR argument is an open file descriptor that refers to a stream.
28 The \fIcommand\fR argument determines the control function to be performed as
29 described below. The \fIarg\fR argument represents additional information that
30 is needed by this command. The type of \fIarg\fR depends upon the command, but
31 it is generally an integer or a pointer to a command-specific data structure.
32 The \fIcommand\fR and \fIarg\fR arguments are interpreted by the STREAM head.
33 Certain combinations of these arguments may be passed to a module or driver in
34 the stream.
35 .sp
36 .LP
37 Since these STREAMS commands are \fBioctls\fR, they are subject to the errors
38 described in \fBioctl\fR(2). In addition to those errors, the call will fail
39 with \fBerrno\fR set to \fBEINVAL,\fR without processing a control function, if
40 the STREAM referenced by \fIfildes\fR is linked below a multiplexor, or if
41 \fIcommand\fR is not a valid value for a stream.
42 .sp
43 .LP
44 Also, as described in \fBioctl\fR(2), STREAMS modules and drivers can detect
45 errors. In this case, the module or driver sends an error message to the STREAM
46 head containing an error value. This causes subsequent calls to fail with
47 \fBerrno\fR set to this value.
48 .SH IOCTLS
49 .sp
50 .LP
51 The following \fBioctl\fR commands, with error values indicated, are applicable
52 to all STREAMS files:
53 .sp
54 .ne 2
55 .na
56 \fB\fBI_PUSH\fR\fR
57 .ad
58 .RS 15n
59 Pushes the module whose name is pointed to by \fIarg\fR onto the top of the
60 current stream, just below the STREAM head. If the STREAM is a pipe, the module
61 will be inserted between the stream heads of both ends of the pipe. It then
62 calls the open routine of the newly-pushed module. On failure, \fBerrno\fR is
63 set to one of the following values:
64 .sp
65 .ne 2
66 .na
67 \fB\fBEINVAL\fR\fR
68 .ad
69 .RS 11n
70 Invalid module name.
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fBEFAULT\fR\fR
77 .ad
78 .RS 11n
79 \fIarg\fR points outside the allocated address space.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fBENXIO\fR\fR
86 .ad
87 .RS 11n
88 Open routine of new module failed.
89 .RE
91 .sp
92 .ne 2
93 .na
94 \fB\fBENXIO\fR\fR
95 .ad
96 .RS 11n
97 Hangup received on \fIfildes\fR.
98 .RE
101 .ne 2
103 \fB\fBENOTSUP\fR\fR
105 .RS 11n
106 Pushing a module is not supported on this stream.
112 .ne 2
114 \fB\fBI_POP\fR\fR
116 .RS 15n
117 Removes the module just below the STREAM head of the STREAM pointed to by
118 \fIfildes\fR. To remove a module from a pipe requires that the module was
119 pushed on the side it is being removed from. \fIarg\fR should be  \fB0\fR in an
120 \fBI_POP\fR request. On failure, \fBerrno\fR is set to one of the following
121 values:
123 .ne 2
125 \fB\fBEINVAL\fR\fR
127 .RS 11n
128 No module present in the stream.
132 .ne 2
134 \fB\fBENXIO\fR\fR
136 .RS 11n
137 Hangup received on \fIfildes\fR.
141 .ne 2
143 \fB\fBEPERM\fR\fR
145 .RS 11n
146 Attempt to pop through an anchor by an unprivileged process.
150 .ne 2
152 \fB\fBENOTSUP\fR\fR
154 .RS 11n
155 Removal is not supported.
161 .ne 2
163 \fB\fBI_ANCHOR\fR\fR
165 .RS 15n
166 Positions the stream anchor to be at the stream's module directly below the
167 stream head. Once this has been done, only a privileged process may pop modules
168 below the anchor on the stream. \fIarg\fR must be \fB0\fR in an \fBI_ANCHOR\fR
169 request. On failure, \fBerrno\fR is set to the following value:
171 .ne 2
173 \fB\fBEINVAL\fR\fR
175 .RS 10n
176 Request to put an anchor on a pipe.
182 .ne 2
184 \fB\fBI_LOOK\fR\fR
186 .RS 15n
187 Retrieves the name of the module just below the stream head of the stream
188 pointed to by \fIfildes\fR, and places it in a null terminated character string
189 pointed at by \fIarg\fR. The buffer pointed to by \fIarg\fR should be at least
190 \fBFMNAMESZ\fR+1 bytes long. This requires the declaration \fB#include
191 <sys/conf.h>\fR. On failure, \fBerrno\fR is set to one of the following values:
193 .ne 2
195 \fB\fBEFAULT\fR\fR
197 .RS 10n
198 \fIarg\fR points outside the allocated address space.
202 .ne 2
204 \fB\fBEINVAL\fR\fR
206 .RS 10n
207 No module present in stream.
213 .ne 2
215 \fB\fBI_FLUSH\fR\fR
217 .RS 15n
218 This request flushes all input and/or output queues, depending on the value of
219 \fIarg\fR. Legal \fIarg\fR values are:
221 .ne 2
223 \fBFLUSHR\fR
225 .RS 11n
226 Flush read queues.
230 .ne 2
232 \fBFLUSHW\fR
234 .RS 11n
235 Flush write queues.
239 .ne 2
241 \fBFLUSHRW\fR
243 .RS 11n
244 Flush read and write queues.
247 If a pipe or FIFO does not have any modules pushed, the read queue of the
248 stream head on either end is flushed depending on the value of \fIarg\fR.
250 If \fBFLUSHR\fR is set and \fIfildes\fR is a pipe, the read queue for that end
251 of the pipe is flushed and the write queue for the other end is flushed. If
252 \fIfildes\fR is a FIFO, both queues are flushed.
254 If \fBFLUSHW\fR is set and \fIfildes\fR is a pipe and the other end of the pipe
255 exists, the read queue for the other end of the pipe is flushed and the write
256 queue for this end is flushed. If \fIfildes\fR is a FIFO, both queues of the
257 FIFO are flushed.
259 If \fBFLUSHRW\fR is set, all read queues are flushed, that is, the read queue
260 for the FIFO and the read queue on both ends of the pipe are flushed.
262 Correct flush handling of a pipe or FIFO with modules pushed is achieved via
263 the \fBpipemod\fR module.  This module should be the first module pushed onto a
264 pipe so that it is at the midpoint of the pipe itself.
266 On failure, \fBerrno\fR is set to one of the following values:
268 .ne 2
270 \fB\fBENOSR\fR\fR
272 .RS 10n
273 Unable to allocate buffers for flush message due to insufficient stream memory
274 resources.
278 .ne 2
280 \fB\fBEINVAL\fR\fR
282 .RS 10n
283 Invalid \fIarg\fR value.
287 .ne 2
289 \fB\fBENXIO\fR\fR
291 .RS 10n
292 Hangup received on \fIfildes\fR.
298 .ne 2
300 \fB\fBI_FLUSHBAND\fR\fR
302 .RS 15n
303 Flushes a particular band of messages. \fIarg\fR points to a \fBbandinfo\fR
304 structure that has the following members:
306 .in +2
308 unsigned char bi_pri;
309 int bi_flag;
311 .in -2
313 The \fBbi_flag\fR field may be one of \fBFLUSHR\fR, \fBFLUSHW\fR, or
314 \fBFLUSHRW\fR as described earlier.
318 .ne 2
320 \fB\fBI_SETSIG\fR\fR
322 .RS 15n
323 Informs the stream head that the user wishes the kernel to issue the
324 \fBSIGPOLL\fR signal (see \fBsignal\fR(3C)) when a particular event has
325 occurred on the stream associated with \fIfildes\fR. \fBI_SETSIG\fR supports an
326 asynchronous processing capability in streams. The value of \fIarg\fR is a
327 bitmask that specifies the events for which the user should be signaled. It is
328 the bitwise OR of any combination of the following constants:
330 .ne 2
332 \fB\fBS_INPUT\fR\fR
334 .RS 13n
335 Any message other than an \fBM_PCPROTO\fR has arrived on a stream head read
336 queue. This event is maintained for compatibility with previous releases. This
337 event is triggered even if the message is of zero length.
341 .ne 2
343 \fB\fBS_RDNORM\fR\fR
345 .RS 13n
346 An ordinary (non-priority) message has arrived on a stream head read queue.
347 This event is triggered even if the message is of zero length.
351 .ne 2
353 \fB\fBS_RDBAND\fR\fR
355 .RS 13n
356 A priority band message (band > 0) has arrived on a stream head read queue.
357 This event is triggered even if the message is of zero length.
361 .ne 2
363 \fB\fBS_HIPRI\fR\fR
365 .RS 13n
366 A high priority message is present on the stream head read queue. This event is
367 triggered even if the message is of zero length.
371 .ne 2
373 \fB\fBS_OUTPUT\fR\fR
375 .RS 13n
376 The write queue just below the stream head is no longer full. This notifies the
377 user that there is room on the queue for sending (or writing) data downstream.
381 .ne 2
383 \fB\fBS_WRNORM\fR\fR
385 .RS 13n
386 This event is the same as \fBS_OUTPUT\fR.
390 .ne 2
392 \fB\fBS_WRBAND\fR\fR
394 .RS 13n
395 A priority band greater than 0 of a queue downstream exists and is writable.
396 This notifies the user that there is room on the queue for sending (or writing)
397 priority data downstream.
401 .ne 2
403 \fB\fBS_MSG\fR\fR
405 .RS 13n
406 A STREAMS signal message that contains the \fBSIGPOLL\fR signal has reached the
407 front of the stream head read queue.
411 .ne 2
413 \fB\fBS_ERROR\fR\fR
415 .RS 13n
416 An \fBM_ERROR\fR message has reached the stream head.
420 .ne 2
422 \fB\fBS_HANGUP\fR\fR
424 .RS 13n
425 An \fBM_HANGUP\fR message has reached the stream head.
429 .ne 2
431 \fB\fBS_BANDURG\fR\fR
433 .RS 13n
434 When used in conjunction with \fBS_RDBAND\fR, \fBSIGURG\fR is generated instead
435 of \fBSIGPOLL\fR when a priority message reaches the front of the stream head
436 read queue.
439 A user process may choose to be signaled only of high priority messages by
440 setting the \fIarg\fR bitmask to the value \fBS_HIPRI\fR.
442 Processes that wish to receive \fBSIGPOLL\fR signals must explicitly register
443 to receive them using \fBI_SETSIG\fR. If several processes register to receive
444 this signal for the same event on the same stream, each process will be
445 signaled when the event occurs.
447 If the value of \fIarg\fR is zero, the calling process will be unregistered and
448 will not receive further \fBSIGPOLL\fR signals.  On failure, \fBerrno\fR is set
449 to one of the following values:
451 .ne 2
453 \fB\fBEINVAL\fR\fR
455 .RS 10n
456 \fIarg\fR value is invalid or \fIarg\fR is zero and process is not registered
457 to receive the \fBSIGPOLL\fR signal.
461 .ne 2
463 \fB\fBEAGAIN\fR\fR
465 .RS 10n
466 Allocation of a data structure to store the signal request failed.
472 .ne 2
474 \fB\fBI_GETSIG\fR\fR
476 .RS 15n
477 Returns the events for which the calling process is currently registered to be
478 sent a \fBSIGPOLL\fR signal.  The events are returned as a bitmask pointed to
479 by \fIarg\fR, where the events are those specified in the description of
480 \fBI_SETSIG\fR above. On failure, \fBerrno\fR is set to one of the following
481 values:
483 .ne 2
485 \fB\fBEINVAL\fR\fR
487 .RS 10n
488 Process not registered to receive the \fBSIGPOLL\fR signal.
492 .ne 2
494 \fB\fBEFAULT\fR\fR
496 .RS 10n
497 \fIarg\fR points outside the allocated address space.
503 .ne 2
505 \fB\fBI_FIND\fR\fR
507 .RS 15n
508 Compares the names of all modules currently present in the stream to the name
509 pointed to by \fIarg\fR, and returns 1 if the named module is present in the
510 stream. It returns 0 if the named module is not present. On failure,
511 \fBerrno\fR is set to one of the following values:
513 .ne 2
515 \fB\fBEFAULT\fR\fR
517 .RS 10n
518 \fIarg\fR points outside the allocated address space.
522 .ne 2
524 \fB\fBEINVAL\fR\fR
526 .RS 10n
527 \fIarg\fR does not contain a valid module name.
533 .ne 2
535 \fB\fBI_PEEK\fR\fR
537 .RS 15n
538 Allows a user to retrieve the information in the first message on the stream
539 head read queue without taking the message off the queue. \fBI_PEEK\fR is
540 analogous to \fBgetmsg\fR(2) except that it does not remove the message from
541 the queue. \fIarg\fR points to a \fBstrpeek\fR structure, which contains the
542 following members:
544 .in +2
546 struct strbuf ctlbuf;
547 struct strbuf   databuf;
548 long flags;
550 .in -2
552 The \fBmaxlen\fR field in the \fBctlbuf\fR and \fBdatabuf\fR \fBstrbuf\fR
553 structures (see \fBgetmsg\fR(2)) must be set to the number of bytes of control
554 information and/or data information, respectively, to retrieve. \fBflags\fR may
555 be set to \fBRS_HIPRI\fR or \fB0\fR. If \fBRS_HIPRI\fR is set, \fBI_PEEK\fR
556 will look for a high priority message on the stream head read queue. Otherwise,
557 \fBI_PEEK\fR will look for the first message on the stream head read queue.
559 \fBI_PEEK\fR returns \fB1\fR if a message was retrieved, and returns \fB0\fR if
560 no message was found on the stream head read queue. It does not wait for a
561 message to arrive. On return, \fBctlbuf\fR specifies information in the control
562 buffer, \fBdatabuf\fR specifies information in the data buffer, and \fBflags\fR
563 contains the value \fBRS_HIPRI\fR or \fB0\fR. On failure, \fBerrno\fR is set to
564 the following value:
566 .ne 2
568 \fB\fBEFAULT\fR\fR
570 .RS 11n
571 \fIarg\fR points, or the buffer area specified in \fBctlbuf\fR or \fBdatabuf\fR
572 is, outside the allocated address space.
576 .ne 2
578 \fB\fBEBADMSG\fR\fR
580 .RS 11n
581 Queued message to be read is not valid for \fBI_PEEK\fR.
585 .ne 2
587 \fB\fBEINVAL\fR\fR
589 .RS 11n
590 Illegal value for \fBflags\fR.
594 .ne 2
596 \fB\fBENOSR\fR\fR
598 .RS 11n
599 Unable to allocate buffers to perform the I_PEEK due to insufficient STREAMS
600 memory resources.
606 .ne 2
608 \fB\fBI_SRDOPT\fR\fR
610 .RS 15n
611 Sets the read mode (see \fBread\fR(2)) using the value of the argument
612 \fIarg\fR. Legal \fIarg\fR values are:
614 .ne 2
616 \fBRNORM\fR
618 .RS 9n
619 Byte-stream mode, the default.
623 .ne 2
625 \fBRMSGD\fR
627 .RS 9n
628 Message-discard mode.
632 .ne 2
634 \fBRMSGN\fR
636 .RS 9n
637 Message-nondiscard mode.
640 In addition, the stream head's treatment of control messages may be changed by
641 setting the following flags in \fIarg\fR:
643 .ne 2
645 \fBRPROTNORM\fR
647 .RS 13n
648 Reject \fBread()\fR with \fBEBADMSG\fR if a control message is at the front of
649 the stream head read queue.
653 .ne 2
655 \fBRPROTDAT\fR
657 .RS 13n
658 Deliver the control portion of a message as data when a user issues
659 \fBread()\fR. This is the default behavior.
663 .ne 2
665 \fBRPROTDIS\fR
667 .RS 13n
668 Discard the control portion of a message, delivering any data portion, when a
669 user issues a \fBread\fR(\|).
672 On failure, \fBerrno\fR is set to the following value:
674 .ne 2
676 \fB\fBEINVAL\fR\fR
678 .RS 10n
679 \fIarg\fR is not one of the above legal values, or \fIarg\fR is the bitwise
680 inclusive \fBOR\fR of \fBRMSGD\fR and \fBRMSGN\fR.
686 .ne 2
688 \fB\fBI_GRDOPT\fR\fR
690 .RS 15n
691 Returns the current read mode setting in an \fBint\fR pointed to by the
692 argument \fIarg\fR. Read modes are described in \fBread\fR(\|). On failure,
693 \fBerrno\fR is set to the following value:
695 .ne 2
697 \fB\fBEFAULT\fR\fR
699 .RS 10n
700 \fIarg\fR points outside the allocated address space.
706 .ne 2
708 \fB\fBI_NREAD\fR\fR
710 .RS 15n
711 Counts the number of data bytes in data blocks in the first message on the
712 stream head read queue, and places this value in the location pointed to by
713 \fIarg\fR. The return value for the command is the number of messages on the
714 stream head read queue. For example, if zero is returned in \fIarg\fR, but the
715 \fBioctl\fR return value is greater than zero, this indicates that a
716 zero-length message is next on the queue. On failure, \fBerrno\fR is set to the
717 following value:
719 .ne 2
721 \fB\fBEFAULT\fR\fR
723 .RS 10n
724 \fIarg\fR points outside the allocated address space.
730 .ne 2
732 \fB\fBI_FDINSERT\fR\fR
734 .RS 15n
735 Creates a message from specified buffer(s), adds information about another
736 stream and sends the message downstream. The message contains a control part
737 and an optional data part. The data and control parts to be sent are
738 distinguished by placement in separate buffers, as described below.
740 The \fIarg\fR argument points to a \fBstrfdinsert\fR structure, which contains
741 the following members:
743 .in +2
745 struct  strbuf  ctlbuf;
746 struct  strbuf  databuf;
747 t_uscalar_t  flags;
748 int  fildes;
749 int  offset;
751 .in -2
753 The \fBlen\fR member in the \fBctlbuf strbuf\fR structure (see \fBputmsg\fR(2))
754 must be set to the size of a  \fBt_uscalar_t\fR plus the number of bytes of
755 control information to be sent with the message. The \fBfildes\fR member
756 specifies the file descriptor of the other stream, and the \fBoffset\fR member,
757 which must be suitably aligned for use as a \fBt_uscalar_t\fR, specifies the
758 offset from the start of the control buffer where \fBI_FDINSERT\fR will store a
759 \fBt_uscalar_t\fR whose interpretation is specific to the stream end. The
760 \fBlen\fR member in the \fBdatabuf strbuf\fR structure must be set to the
761 number of bytes of data information to be sent with the message, or to 0 if no
762 data part is to be sent.
764 The \fBflags\fR member specifies the type of message to be created. A normal
765 message is created if \fBflags\fR is set to 0, and a high-priority message is
766 created if \fBflags\fR is set to \fBRS_HIPRI\fR. For non-priority messages,
767 \fBI_FDINSERT\fR will block if the stream write queue is full due to internal
768 flow control conditions. For priority messages,  \fBI_FDINSERT\fR does not
769 block on this condition. For non-priority messages,  \fBI_FDINSERT\fR does not
770 block when the write queue is full and  \fBO_NDELAY\fR or  \fBO_NONBLOCK\fR is
771 set. Instead, it fails and sets \fBerrno\fR to \fBEAGAIN\fR.
773 \fBI_FDINSERT\fR also blocks, unless prevented by lack of internal resources,
774 waiting for the availability of message blocks in the stream, regardless of
775 priority or whether \fBO_NDELAY\fR or \fBO_NONBLOCK\fR has been specified. No
776 partial message is sent.
778 The \fBioctl()\fR function with the \fBI_FDINSERT\fR command will fail if:
780 .ne 2
782 \fB\fBEAGAIN\fR\fR
784 .RS 10n
785 A non-priority message is specified, the \fBO_NDELAY\fR or \fBO_NONBLOCK\fR
786 flag is set, and the stream write queue is full due to internal flow control
787 conditions.
791 .ne 2
793 \fB\fBENOSR\fR\fR
795 .RS 10n
796 Buffers can not be allocated for the message that is to be created.
800 .ne 2
802 \fB\fBEFAULT\fR\fR
804 .RS 10n
805 The \fIarg\fR argument points, or the buffer area specified in \fBctlbuf\fR or
806 \fBdatabuf\fR is, outside the allocated address space.
810 .ne 2
812 \fB\fBEINVAL\fR\fR
814 .RS 10n
815 One of the following: The \fBfildes\fR member of the \fBstrfdinsert\fR
816 structure is not a valid, open stream file descriptor; the size of a
817 \fBt_uscalar_t\fR plus \fBoffset\fR is greater than the \fBlen\fR member for
818 the buffer specified through \fBctlptr\fR; the \fBoffset\fR member does not
819 specify a properly-aligned location in the data buffer; or an undefined value
820 is stored in \fBflags\fR.
824 .ne 2
826 \fB\fBENXIO\fR\fR
828 .RS 10n
829 Hangup received on the \fBfildes\fR argument of the \fBioctl\fR call or the
830 \fBfildes\fR member of the \fBstrfdinsert\fR structure.
834 .ne 2
836 \fB\fBERANGE\fR\fR
838 .RS 10n
839 The \fBlen\fR field for the buffer specified through \fBdatabuf\fR does not
840 fall within the range specified by the maximum and minimum packet sizes of the
841 topmost stream module; or the \fBlen\fR member for the buffer specified through
842 \fBdatabuf\fR is larger than the maximum configured size of the data part of a
843 message; or the \fBlen\fR member for the buffer specified through \fBctlbuf\fR
844 is larger than the maximum configured size of the control part of a message.
847 \fBI_FDINSERT\fR can also fail if an error message was received by the stream
848 head of the stream corresponding to the \fBfildes\fR member of the
849 \fBstrfdinsert\fR structure. In this case, \fBerrno\fR will be set to the value
850 in the message.
854 .ne 2
856 \fB\fBI_STR\fR\fR
858 .RS 15n
859 Constructs an internal \fBSTREAMS\fR ioctl message from the data pointed to by
860 \fIarg\fR, and sends that message downstream.
862 This mechanism is provided to send user \fBioctl\fR requests to downstream
863 modules and drivers. It allows information to be sent with the \fBioctl\fR, and
864 will return to the user any information sent upstream by the downstream
865 recipient. \fBI_STR\fR blocks until the system responds with either a positive
866 or negative acknowledgement message, or until the request times out after some
867 period of time. If the request times out, it fails with \fBerrno\fR set to
868 \fBETIME\fR.
870 To send requests downstream, \fIarg\fR must point to a \fBstrioctl\fR structure
871 which contains the following members:
873 .in +2
875 int  ic_cmd;
876 int  ic_timout;
877 int  ic_len;
878 char  *ic_dp;
880 .in -2
882 \fBic_cmd\fR is the internal \fBioctl\fR command intended for a downstream
883 module or driver and \fBic_timout\fR is the number of seconds (-1 = infinite, 0
884 = use default, >0 = as specified) an \fBI_STR\fR request will wait for
885 acknowledgement before timing out. \fBic_len\fR is the number of bytes in the
886 data argument and \fBic_dp\fR is a pointer to the data argument. The
887 \fBic_len\fR field has two uses: on input, it contains the length of the data
888 argument passed in, and on return from the command, it contains the number of
889 bytes being returned to the user (the buffer pointed to by \fBic_dp\fR should
890 be large enough to contain the maximum amount of data that any module or the
891 driver in the stream can return).
893 At most one \fBI_STR\fR can be active on a stream.  Further \fBI_STR\fR calls
894 will block until the active \fBI_STR\fR completes via  a  positive  or negative
895 acknowlegment, a timeout, or an error condition at the stream head.  By setting
896 the \fBic_timout\fR  field  to  0, the  user is requesting STREAMS to provide
897 the  \fBDEFAULT\fR timeout. The default timeout is specific to the STREAMS
898 implementation and may vary depending on which release of Solaris you are
899 using. For Solaris 8 (and earlier versions), the default timeout is fifteen
900 seconds. The \fBO_NDELAY\fR and \fBO_NONBLOCK\fR (see \fBopen\fR(2)) flags have
901 no effect on this call.
903 The stream head will convert the information pointed to by the \fBstrioctl\fR
904 structure to an internal \fBioctl\fR command message and send it downstream. On
905 failure, \fBerrno\fR is set to one of the following values:
907 .ne 2
909 \fB\fBENOSR\fR\fR
911 .RS 10n
912 Unable to allocate buffers for the \fBioctl\fR message due to insufficient
913 STREAMS memory resources.
917 .ne 2
919 \fB\fBEFAULT\fR\fR
921 .RS 10n
922 Either \fIarg\fR points outside the allocated address space, or the buffer area
923 specified by \fBic_dp\fR and \fBic_len\fR (separately for data sent and data
924 returned) is outside the allocated address space.
928 .ne 2
930 \fB\fBEINVAL\fR\fR
932 .RS 10n
933 \fBic_len\fR is less than 0 or \fBic_len\fR is larger than the maximum
934 configured size of the data part of a message or \fBic_timout\fR is less than
939 .ne 2
941 \fB\fBENXIO\fR\fR
943 .RS 10n
944 Hangup received on \fIfildes\fR.
948 .ne 2
950 \fB\fBETIME\fR\fR
952 .RS 10n
953 A downstream \fBioctl\fR timed out before acknowledgement was received.
956 An \fBI_STR\fR can also fail while waiting for an acknowledgement if a message
957 indicating an error or a hangup is received at the stream head. In addition, an
958 error code can be returned in the positive or negative acknowledgement message,
959 in the event the ioctl command sent downstream fails. For these cases,
960 \fBI_STR\fR will fail with \fBerrno\fR set to the value in the message.
964 .ne 2
966 \fB\fBI_SWROPT\fR\fR
968 .RS 15n
969 Sets the write mode using the value of the argument \fIarg\fR. Legal bit
970 settings for \fIarg\fR are:
972 .ne 2
974 \fB\fBSNDZERO\fR\fR
976 .RS 11n
977 Send a zero-length message downstream when a write of 0 bytes occurs.
980 To not send a zero-length message when a write of 0 bytes occurs, this bit must
981 not be set in \fIarg\fR.
983 On failure, \fBerrno\fR may be set to the following value:
985 .ne 2
987 \fB\fBEINVAL\fR\fR
989 .RS 10n
990 \fIarg\fR is not the above legal value.
996 .ne 2
998 \fB\fBI_GWROPT\fR\fR
1000 .RS 15n
1001 Returns the current write mode setting, as described above, in the \fBint\fR
1002 that is pointed to by the argument \fIarg\fR.
1006 .ne 2
1008 \fB\fBI_SENDFD\fR\fR
1010 .RS 15n
1011 Requests the stream associated with \fIfildes\fR to send a message, containing
1012 a file pointer, to the stream head at the other end of a stream pipe. The file
1013 pointer corresponds to \fIarg\fR, which must be an open file descriptor.
1015 \fBI_SENDFD\fR converts \fIarg\fR into the corresponding system file pointer.
1016 It allocates a message block and inserts the file pointer in the block.  The
1017 user id and group id associated with the sending process are also inserted.
1018 This message is placed directly on the read queue (see \fBIntro\fR(3)) of the
1019 stream head at the other end of the stream pipe to which it is connected.  On
1020 failure, \fBerrno\fR is set to one of the following values:
1022 .ne 2
1024 \fB\fBEAGAIN\fR\fR
1026 .RS 10n
1027 The sending stream is unable to allocate a message block to contain the file
1028 pointer.
1032 .ne 2
1034 \fB\fBEAGAIN\fR\fR
1036 .RS 10n
1037 The read queue of the receiving stream head is full and cannot accept the
1038 message sent by \fBI_SENDFD.\fR
1042 .ne 2
1044 \fB\fBEBADF\fR\fR
1046 .RS 10n
1047 \fIarg\fR is not a valid, open file descriptor.
1051 .ne 2
1053 \fB\fBEINVAL\fR\fR
1055 .RS 10n
1056 \fIfildes\fR is not connected to a stream pipe.
1060 .ne 2
1062 \fB\fBENXIO\fR\fR
1064 .RS 10n
1065 Hangup received on \fIfildes\fR.
1071 .ne 2
1073 \fB\fBI_RECVFD\fR\fR
1075 .RS 15n
1076 Retrieves the file descriptor associated with the message sent by an
1077 \fBI_SENDFD\fR \fBioctl\fR over a stream pipe. \fIarg\fR is a pointer to a data
1078 buffer large enough to hold an \fBstrrecvfd\fR data structure containing the
1079 following members:
1081 .in +2
1083 int  fd;
1084 uid_t  uid;
1085 gid_t  gid;
1087 .in -2
1089 \fBfd\fR is an integer file descriptor. \fBuid\fR and \fBgid\fR are the user id
1090 and group id, respectively, of the sending stream.
1092 If \fBO_NDELAY\fR and \fBO_NONBLOCK\fR are clear (see \fBopen\fR(2)),
1093 \fBI_RECVFD\fR will block until a message is present at the stream head. If
1094 \fBO_NDELAY\fR or \fBO_NONBLOCK\fR is set, \fBI_RECVFD\fR will fail with
1095 \fBerrno\fR set to \fBEAGAIN\fR if no message is present at the stream head.
1097 If the message at the stream head is a message sent by an \fBI_SENDFD\fR, a new
1098 user file descriptor is allocated for the file pointer contained in the
1099 message. The new file descriptor is placed in the \fBfd\fR field of the
1100 \fBstrrecvfd\fR structure. The structure is copied into the user data buffer
1101 pointed to by \fIarg\fR. On failure, \fBerrno\fR is set to one of the following
1102 values:
1104 .ne 2
1106 \fB\fBEAGAIN\fR\fR
1108 .RS 13n
1109 A message is not present at the stream head read queue, and the \fBO_NDELAY\fR
1110 or \fBO_NONBLOCK\fR flag is set.
1114 .ne 2
1116 \fB\fBEBADMSG\fR\fR
1118 .RS 13n
1119 The message at the stream head read queue is not a message containing a passed
1120 file descriptor.
1124 .ne 2
1126 \fB\fBEFAULT\fR\fR
1128 .RS 13n
1129 \fIarg\fR points outside the allocated address space.
1133 .ne 2
1135 \fB\fBEMFILE\fR\fR
1137 .RS 13n
1138 \fBNOFILES\fR file descriptors are currently open.
1142 .ne 2
1144 \fB\fBENXIO\fR\fR
1146 .RS 13n
1147 Hangup received on \fIfildes\fR.
1151 .ne 2
1153 \fB\fBEOVERFLOW\fR\fR
1155 .RS 13n
1156 \fIuid\fR or \fIgid\fR is too large to be stored in the structure pointed to by
1157 \fIarg\fR.
1163 .ne 2
1165 \fB\fBI_LIST\fR\fR
1167 .RS 15n
1168 Allows the user to list all the module names on the stream, up to and including
1169 the topmost driver name. If \fIarg\fR is \fINULL\fR, the return value is the
1170 number of modules, including the driver, that are on the stream pointed to by
1171 \fIfildes\fR. This allows the user to allocate enough space for the module
1172 names. If \fIarg\fR is non-null, it should point to an \fBstr_list\fR structure
1173 that has the following members:
1175 .in +2
1177 int sl_nmods;
1178 struct  str_mlist  *sl_modlist;
1180 .in -2
1182 The \fBstr_mlist\fR structure has the following member:
1184 .in +2
1186 char l_name[FMNAMESZ+1];
1188 .in -2
1190 The \fBsl_nmods\fR member indicates the number of entries the process has
1191 allocated in the array.  Upon return, the \fBsl_modlist\fR member of the
1192 \fBstr_list\fR structure contains the list of module names, and the number of
1193 entries that have been filled into the \fBsl_modlist\fR array is found in the
1194 \fBsl_nmods\fR member (the number includes the number of modules including the
1195 driver).  The return value from \fBioctl()\fR is 0.  The entries are filled in
1196 starting at the top of the stream and continuing downstream until either the
1197 end of the stream is reached, or the number of requested modules
1198 (\fBsl_nmods\fR) is satisfied. On failure, \fBerrno\fR may be set to one of the
1199 following values:
1201 .ne 2
1203 \fB\fBEINVAL\fR\fR
1205 .RS 10n
1206 The \fBsl_nmods\fR member is less than 1.
1210 .ne 2
1212 \fB\fBEAGAIN\fR\fR
1214 .RS 10n
1215 Unable to allocate buffers
1221 .ne 2
1223 \fB\fBI_ATMARK\fR\fR
1225 .RS 15n
1226 Allows the user to see if the current message on the stream head read queue is
1227 ``marked'' by some module downstream. \fIarg\fR determines how the checking is
1228 done when there may be multiple marked messages on the stream head read queue.
1229 It may take the following values:
1231 .ne 2
1233 \fB\fBANYMARK\fR\fR
1235 .RS 12n
1236 Check if the message is marked.
1240 .ne 2
1242 \fB\fBLASTMARK\fR\fR
1244 .RS 12n
1245 Check if the message is the last one marked on the queue.
1248 The return value is \fB1\fR if the mark condition is satisfied and \fB0\fR
1249 otherwise. On failure, \fBerrno\fR is set to the following value:
1251 .ne 2
1253 \fB\fBEINVAL\fR\fR
1255 .RS 10n
1256 Invalid \fIarg\fR value.
1262 .ne 2
1264 \fB\fBI_CKBAND\fR\fR
1266 .RS 15n
1267 Check if the message of a given priority band exists on the stream head read
1268 queue. This returns \fB1\fR if a message of a given priority exists, \fB0\fR if
1269 not, or \fB\(mi1\fR on error. \fIarg\fR should be an integer containing the
1270 value of the priority band in question. On failure, \fBerrno\fR is set to the
1271 following value:
1273 .ne 2
1275 \fB\fBEINVAL\fR\fR
1277 .RS 10n
1278 Invalid \fIarg\fR value.
1284 .ne 2
1286 \fB\fBI_GETBAND\fR\fR
1288 .RS 15n
1289 Returns the priority band of the first message on the stream head read queue in
1290 the integer referenced by \fIarg\fR. On failure, \fBerrno\fR is set to the
1291 following value:
1293 .ne 2
1295 \fB\fBENODATA\fR\fR
1297 .RS 11n
1298 No message on the stream head read queue.
1304 .ne 2
1306 \fB\fBI_CANPUT\fR\fR
1308 .RS 15n
1309 Check if a certain band is writable. \fIarg\fR is set to the priority band in
1310 question. The return value is \fB0\fR if the priority band \fIarg\fR is flow
1311 controlled, \fB1\fR if the band is writable, or \fB\(mi1\fR on error. On
1312 failure, \fBerrno\fR is set to the following value:
1314 .ne 2
1316 \fB\fBEINVAL\fR\fR
1318 .RS 10n
1319 Invalid \fIarg\fR value.
1325 .ne 2
1327 \fB\fBI_SETCLTIME\fR\fR
1329 .RS 15n
1330 Allows the user to set the time the stream head will delay when a stream is
1331 closing and there are data on the write queues.  Before closing each module and
1332 driver, the stream head will delay for the specified amount of time to allow
1333 the data to drain. Note, however, that the module or driver may itself delay in
1334 its close routine; this delay is independent of the stream head's delay and is
1335 not settable. If, after the delay, data are still present, data will be
1336 flushed. \fIarg\fR is a pointer to an integer containing the number of
1337 milliseconds to delay, rounded up to the nearest legal value on the system.
1338 The default is fifteen seconds. On failure, \fBerrno\fR is set to the following
1339 value:
1341 .ne 2
1343 \fB\fBEINVAL\fR\fR
1345 .RS 10n
1346 Invalid \fIarg\fR value.
1352 .ne 2
1354 \fB\fBI_GETCLTIME\fR\fR
1356 .RS 15n
1357 Returns the close time delay in the integer pointed by \fIarg\fR.
1361 .ne 2
1363 \fB\fBI_SERROPT\fR\fR
1365 .RS 15n
1366 Sets the error mode using the value of the argument \fIarg\fR.
1368 Normally stream head errors are persistent; once they are set due to an
1369 \fBM_ERROR\fR or \fBM_HANGUP\fR, the error condition will remain until the
1370 stream is closed. This option can be used to set the stream head into
1371 non-persistent error mode i.e. once the error has been returned in response to
1372 a \fBread\fR(2), \fBgetmsg\fR(2), \fBioctl\fR(2), \fBwrite\fR(2), or
1373 \fBputmsg\fR(2) call the error condition will be cleared. The error mode can be
1374 controlled independently for read and write side errors. Legal \fIarg\fR values
1375 are either none or one of:
1377 .ne 2
1379 \fB\fBRERRNORM\fR\fR
1381 .RS 18n
1382 Persistent read errors, the default.
1386 .ne 2
1388 \fB\fBRERRNONPERSIST\fR\fR
1390 .RS 18n
1391 Non-persistent read errors.
1394 \fBOR'ed\fR with either none or one of:
1396 .ne 2
1398 \fB\fBWERRNORM\fR\fR
1400 .RS 18n
1401 Persistent write errors, the default.
1405 .ne 2
1407 \fB\fBWERRNONPERSIST\fR\fR
1409 .RS 18n
1410 Non-persistent write errors.
1412 When no value is specified e.g. for the read side error behavior then the
1413 behavior for that side will be left unchanged.
1416 On failure, \fBerrno\fR is set to the following value:
1418 .ne 2
1420 \fB\fBEINVAL\fR\fR
1422 .RS 10n
1423 \fIarg\fR is not one of the above legal values.
1429 .ne 2
1431 \fB\fBI_GERROPT\fR\fR
1433 .RS 15n
1434 Returns the current error mode setting in an \fBint\fR pointed to by the
1435 argument \fIarg\fR. Error modes are described above for \fBI_SERROPT\fR. On
1436 failure,\fBerrno\fR is set to the following value:
1438 .ne 2
1440 \fB\fBEFAULT\fR\fR
1442 .RS 10n
1443 \fIarg\fR points outside the allocated address space.
1450 The following four commands are used for connecting and disconnecting
1451 multiplexed STREAMS configurations.
1453 .ne 2
1455 \fB\fBI_LINK\fR\fR
1457 .RS 13n
1458 Connects two streams, where \fIfildes\fR is the file descriptor of the stream
1459 connected to the multiplexing driver, and \fIarg\fR is the file descriptor of
1460 the stream connected to another driver. The stream designated by \fIarg\fR gets
1461 connected below the multiplexing driver. \fBI_LINK\fR requires the multiplexing
1462 driver to send an acknowledgement message to the stream head regarding the
1463 linking operation. This call returns a multiplexor ID number (an identifier
1464 used to disconnect the multiplexor, see \fBI_UNLINK\fR) on success, and -1 on
1465 failure. On failure, \fBerrno\fR is set to one of the following values:
1467 .ne 2
1469 \fB\fBENXIO\fR\fR
1471 .RS 10n
1472 Hangup received on \fIfildes\fR.
1476 .ne 2
1478 \fB\fBETIME\fR\fR
1480 .RS 10n
1481 Time out before acknowledgement message was received at stream head.
1485 .ne 2
1487 \fB\fBEAGAIN\fR\fR
1489 .RS 10n
1490 Temporarily unable to allocate storage to perform the \fBI_LINK.\fR
1494 .ne 2
1496 \fB\fBENOSR\fR\fR
1498 .RS 10n
1499 Unable to allocate storage to perform the \fBI_LINK\fR due to insufficient
1500 \fBSTREAMS\fR memory resources.
1504 .ne 2
1506 \fB\fBEBADF\fR\fR
1508 .RS 10n
1509 \fIarg\fR is not a valid, open file descriptor.
1513 .ne 2
1515 \fB\fBEINVAL\fR\fR
1517 .RS 10n
1518 \fIfildes\fR stream does not support multiplexing.
1522 .ne 2
1524 \fB\fBEINVAL\fR\fR
1526 .RS 10n
1527 \fIarg\fR is not a stream, or is already linked under a multiplexor.
1531 .ne 2
1533 \fB\fBEINVAL\fR\fR
1535 .RS 10n
1536 The specified link operation would cause a ``cycle'' in the resulting
1537 configuration; that is, a driver would be linked into the multiplexing
1538 configuration in more than one place.
1542 .ne 2
1544 \fB\fBEINVAL\fR\fR
1546 .RS 10n
1547 \fIfildes\fR is the file descriptor of a pipe or FIFO.
1551 .ne 2
1553 \fB\fBEINVAL\fR\fR
1555 .RS 10n
1556 Either the upper or lower stream has a major number >= the maximum major number
1557 on the system.
1560 An \fBI_LINK\fR can also fail while waiting for the multiplexing driver to
1561 acknowledge the link request, if a message indicating an error or a hangup is
1562 received at the stream head of \fIfildes\fR. In addition, an error code can be
1563 returned in the positive or negative acknowledgement message.  For these cases,
1564 \fBI_LINK\fR will fail with \fBerrno\fR set to the value in the message.
1568 .ne 2
1570 \fB\fBI_UNLINK\fR\fR
1572 .RS 13n
1573 Disconnects the two streams specified by \fIfildes\fR and \fIarg\fR.
1574 \fIfildes\fR is the file descriptor of the stream connected to the multiplexing
1575 driver. \fIarg\fR is the multiplexor ID number that was returned by the
1576 \fBI_LINK\fR. If \fIarg\fR is -1, then all streams that were linked to
1577 \fIfildes\fR are disconnected.  As in \fBI_LINK\fR, this command requires the
1578 multiplexing driver to acknowledge the unlink. On failure, \fBerrno\fR is set
1579 to one of the following values:
1581 .ne 2
1583 \fB\fBENXIO\fR\fR
1585 .RS 10n
1586 Hangup received on \fIfildes\fR.
1590 .ne 2
1592 \fB\fBETIME\fR\fR
1594 .RS 10n
1595 Time out before acknowledgement message was received at stream head.
1599 .ne 2
1601 \fB\fBENOSR\fR\fR
1603 .RS 10n
1604 Unable to allocate storage to perform the \fBI_UNLINK\fR due to insufficient
1605 STREAMS memory resources.
1609 .ne 2
1611 \fB\fBEINVAL\fR\fR
1613 .RS 10n
1614 \fIarg\fR is an invalid multiplexor ID number or \fIfildes\fR is not the stream
1615 on which the \fBI_LINK\fR that returned \fIarg\fR was performed.
1619 .ne 2
1621 \fB\fBEINVAL\fR\fR
1623 .RS 10n
1624 \fIfildes\fR is the file descriptor of a pipe or FIFO.
1627 An  \fBI_UNLINK\fR can also fail while waiting for the multiplexing driver to
1628 acknowledge the link request, if a message indicating an error or a hangup is
1629 received at the stream head of \fIfildes\fR. In addition, an error code can be
1630 returned in the positive or negative acknowledgement message. For these cases,
1631 \fBI_UNLINK\fR will fail with \fBerrno\fR set to the value in the message.
1635 .ne 2
1637 \fB\fBI_PLINK\fR\fR
1639 .RS 13n
1640 Connects two streams, where \fIfildes\fR is the file descriptor of the stream
1641 connected to the multiplexing driver, and \fIarg\fR is the file descriptor of
1642 the stream connected to another driver. The stream designated by \fIarg\fR gets
1643 connected via a persistent link below the multiplexing driver. \fBI_PLINK\fR
1644 requires the multiplexing driver to send an acknowledgement message to the
1645 stream head regarding the linking operation. This call creates a persistent
1646 link that continues to exist even if the file descriptor \fIfildes\fR
1647 associated with the upper stream to the multiplexing driver is closed. This
1648 call returns a multiplexor ID number (an identifier that may be used to
1649 disconnect the multiplexor, see \fBI_PUNLINK\fR) on success, and -1 on failure.
1650 On failure, \fBerrno\fR is set to one of the following values:
1652 .ne 2
1654 \fB\fBENXIO\fR\fR
1656 .RS 10n
1657 Hangup received on \fIfildes\fR.
1661 .ne 2
1663 \fB\fBETIME\fR\fR
1665 .RS 10n
1666 Time out before acknowledgement message was received at the stream head.
1670 .ne 2
1672 \fB\fBEAGAIN\fR\fR
1674 .RS 10n
1675 Unable to allocate STREAMS storage to perform the  \fBI_PLINK.\fR
1679 .ne 2
1681 \fB\fBEBADF\fR\fR
1683 .RS 10n
1684 \fIarg\fR is not a valid, open file descriptor.
1688 .ne 2
1690 \fB\fBEINVAL\fR\fR
1692 .RS 10n
1693 \fIfildes\fR does not support multiplexing.
1697 .ne 2
1699 \fB\fBEINVAL\fR\fR
1701 .RS 10n
1702 \fIarg\fR is not a stream or is already linked under a multiplexor.
1706 .ne 2
1708 \fB\fBEINVAL\fR\fR
1710 .RS 10n
1711 The specified link operation would cause a ``cycle'' in the resulting
1712 configuration; that is, if a driver would be linked into the multiplexing
1713 configuration in more than one place.
1717 .ne 2
1719 \fB\fBEINVAL\fR\fR
1721 .RS 10n
1722 \fIfildes\fR is the file descriptor of a pipe or FIFO.
1725 An \fBI_PLINK\fR can also fail while waiting for the multiplexing driver to
1726 acknowledge the link request, if a message indicating an error on a hangup is
1727 received at the stream head of \fIfildes\fR. In addition, an error code can be
1728 returned in the positive or negative acknowledgement message.  For these cases,
1729 \fBI_PLINK\fR will fail with \fBerrno\fR set to the value in the message.
1733 .ne 2
1735 \fB\fBI_PUNLINK\fR\fR
1737 .RS 13n
1738 Disconnects the two streams specified by \fIfildes\fR and \fIarg\fR that are
1739 connected with a persistent link. \fIfildes\fR is the file descriptor of the
1740 stream connected to the multiplexing driver. \fIarg\fR is the multiplexor ID
1741 number that was returned by \fBI_PLINK\fR when a stream was linked below the
1742 multiplexing driver. If \fIarg\fR is  \fBMUXID_ALL\fR then all streams that are
1743 persistent links to \fIfildes\fR are disconnected. As in  \fBI_PLINK,\fR this
1744 command requires the multiplexing driver to acknowledge the unlink. On failure,
1745 \fBerrno\fR is set to one of the following values:
1747 .ne 2
1749 \fB\fBENXIO\fR\fR
1751 .RS 10n
1752 Hangup received on \fIfildes\fR.
1756 .ne 2
1758 \fB\fBETIME\fR\fR
1760 .RS 10n
1761 Time out before acknowledgement message was received at the stream head.
1765 .ne 2
1767 \fB\fBEAGAIN\fR\fR
1769 .RS 10n
1770 Unable to allocate buffers for the acknowledgement message.
1774 .ne 2
1776 \fB\fBEINVAL\fR\fR
1778 .RS 10n
1779 Invalid multiplexor ID number.
1783 .ne 2
1785 \fB\fBEINVAL\fR\fR
1787 .RS 10n
1788 \fIfildes\fR is the file descriptor of a pipe or FIFO.
1791 An \fBI_PUNLINK\fR can also fail while waiting for the multiplexing driver to
1792 acknowledge the link request if a message indicating an error or a hangup is
1793 received at the stream head of \fIfildes\fR. In addition, an error code can be
1794 returned in the positive or negative acknowledgement message.  For these cases,
1795 \fBI_PUNLINK\fR will fail with \fBerrno\fR set to the value in the message.
1798 .SH RETURN VALUES
1801 Unless specified otherwise above, the return value from \fBioctl()\fR is
1802 \fB0\fR upon success and  \fB\(mi1\fR upon failure, with \fIerrno\fR set as
1803 indicated.
1804 .SH SEE ALSO
1807 \fBIntro\fR(3), \fBclose\fR(2), \fBfcntl\fR(2), \fBgetmsg\fR(2),
1808 \fBioctl\fR(2), \fBopen\fR(2), \fBpoll\fR(2), \fBputmsg\fR(2), \fBread\fR(2),
1809 \fBwrite\fR(2), \fBsignal\fR(3C), \fBsignal.h\fR(3HEAD),
1812 \fISTREAMS Programming Guide\fR