Technical data
SunOS 5.5 Ioctl Requests streamio(7I)
To send requests downstream, arg must point to a strioctl structure
which contains the following members:
int ic_cmd;
int ic_timout;
int ic_len;
char ∗ic_dp;
ic_cmd is the internal ioctl command intended for a downstream
module or driver and ic_timout is the number of seconds (-1 = infinite, 0
= use default, >0 = as specified) an I_STR request will wait for ack-
nowledgement before timing out. ic_len is the number of bytes in the
data argument and ic_dp is a pointer to the data argument. The ic_len
field has two uses: on input, it contains the length of the data argument
passed in, and on return from the command, it contains the number of
bytes being returned to the user (the buffer pointed to by ic_dp should
be large enough to contain the maximum amount of data that any
module or the driver in the stream can return).
The stream head will convert the information pointed to by the strioctl
structure to an internal ioctl command message and send it down-
stream. On failure, errno is set to one of the following values:
ENOSR Unable to allocate buffers for the ioctl message due to
insufficientSTREAMS memory resources.
EFAULT Either arg points outside the allocated address space, or
the buffer area specified by ic_dp and ic_len
(separately for data sent and data returned) is outside
the allocated address space.
EINVAL ic_len is less than 0 or ic_len is larger than the max-
imum configured size of the data part of a message or
ic_timout is less than -1.
ENXIO Hangup received on fildes.
ETIME A downstream ioctl timed out before acknowledge-
ment was received.
An I_STR can also fail while waiting for an acknowledgement if a mes-
sage indicating an error or a hangup is received at the stream head. In
addition, an error code can be returned in the positive or negative ack-
nowledgement message, in the event the ioctl command sent down-
stream fails. For these cases, I_STR will fail with errno set to the value in
the message.
modified 24 Jan 1995 7I-333










