I_NREAD streamio Operation

Purpose

Counts the number of data bytes in data blocks in the first message on the stream-head read queue, and places this value in a specified location.

Description

The I_NREAD operation counts the number of data bytes in data blocks in the first message on the stream-head read queue, and places this value in the location pointed to by the arg parameter.

This operation is part of STREAMS Kernel Extensions.

Return Values

The return value for the operation is the number of messages on the stream-head read queue. For example, if a value of 0 is returned in the arg parameter, but the ioctl operation return value is greater than 0, this indicates that a zero-length message is next on the queue.

Error Codes

If unsuccessful, the errno global variable is set to the following value:

Value Description
EFAULT The arg parameter points outside the allocated address space.