streamio.7 (2010 09)
s
streamio(7) streamio(7)
The I_PEEK returns a 1 if a message was retrieved, and returns a value of 0 (zero)
if no message was found; it does not wait for a message. Upon successful comple-
tion, ctlbuf specifies control information in the control buffer,
databuf
specifies data information in the data buffer, and flags contains
RS_HIPRI or 0
(zero).
I_PLINK Connects two streams, where fildes is the file descriptor of the stream connected to
the multiplexing driver, and arg is the file descriptor of the stream connected to
another driver. The stream designated by arg gets connected via a persistent link
below the multiplexing driver. I_PLINK requires the multiplexing driver to send
an acknowledgement message to the stream head regarding the linking operation.
This call creates a persistent link which can exist even if the file descriptor associ-
ated with the upper stream to the multiplexing driver is closed. This call returns a
multiplexor ID number (an identifier that may be used to disconnect the multi-
plexor, see I_PUNLINK) on success and −1 on failure.
The
I_PLINK ioctl can also fail if it is waiting for the multiplexing driver to
acknowledge the link request and an error (
M_ERROR) message, or hangup
(
M_HANGUP) message is received at the stream head for fildes . In addition, an
error can be returned in an
M_IOACK or
M_IONAK message. When these occur, the
I_PLINK fails with errno set to the value in the message.
I_POP Removes the module just below the stream head of the stream pointed to by fildes.
To remove a module from a pipe requires that the module was pushed on the side it
is being removed from. arg should be 0 in an
I_POP request.
I_PUNLINK Disconnects the two streams specified by fildes and arg that are connected with a
persistent link. fildes is the file descriptor of the stream connected to the multiplex-
ing driver. arg is the multiplexor ID number that was returned by I_PLINK when
a stream was linked below the multiplexing driver. If arg is MUXID_ALL, then all
streams which are persistent links to fildes are disconnected. As in
I_PLINK, this
command requires the multiplexing driver to acknowledge the unlink.
I_PUSH Pushes the module whose name is pointed by arg onto the top of the current stream,
just below the stream head. If the stream is a pipe, the module will be inserted
between the streams heads of both ends of the pipe. It then calls the open routine
of the newly-pushed module.
I_RECVFD Retrieves the file descriptor associated with the message sent by an I_SENDFD
ioctl over a stream pipe. arg is a pointer to a data buffer large enough to hold a
strrecvfd data structure containing the following members:
int fd;
uid_t uid;
gid_t gid;
char fill[8]
fd is an integer file descriptor. uid and gid are the user ID and group ID,
respectively, of the sending stream.
If
O_NONBLOCK is clear, I_RECVFD will block until a message is present at the
stream head. If O_NONBLOCK is set, I_RECVFD will fail with errno set to
[EAGAIN] if no message is present at the stream head.
If the message at the stream head is a message sent by a
I_SENDFD, a new user
file descriptor is allocated for the file pointer contained in the message. The new
file descriptor is placed in the fd field of the strrecvfd structure. The structure
is copied into the user data buffer pointed to by arg.
I_SENDFD Requests the stream associated with fildes to send a message, containing a file
pointer, to the stream head at the other end of a stream pipe. The file pointer
corresponds to arg, which must be an open file descriptor.
I_SENDFD converts arg into the corresponding system file pointer. It allocates a
message block and inserts the file pointer in the block. The user ID and group ID
associated with the sending process are also inserted. This message is placed
directly on the read queue of the stream head at the other end of the stream pipe to
which it is connected.
4 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: September 2010