MPE/iX Intrinsics Reference Manual (32650-90905)

428 Chapter8
Command Definitions (HPMERGEEND-LOGSTATUS)
HPSELECT
HPSELECT
Determine whether a file or group of files is ready to perform reads, writes, or if it has an
exception condition, and whether to block on one or more of these events if the condition is
not currently true.
Syntax
I16 IV CA CA
numselect
:=HPSELECT(
numfiles
,
readmask
,
writemask
,
CA R I32
exceptionmask
,
timeout
,
status
)
Functional Return
numselect
16-bit signed integer (assigned functional return)
Returns a value representing the number of files that have selected true.
The following values are returned:
Value Meaning
n The number of files that have selected true.
0 If a timeout value was assigned and the select "timed out".
-1 If an error occurred in the call, an internal error occurred,
or if a soft interrupt occurred before any selected events or
before the time limit expired.
Parameters
numfiles
integer by value (required)
Passes the number of files (number of files -1) whose bits will be checked
by HPSELECT.
Note that this parameter does not represent the number of files where a
bit in one of the masks is being set. It represents the highest file number
(minus 1) that will be examined by HPSELECT.
readmask
character array by reference (optional)
Specifies which file numbers will be examined to see if the file that is ready
for reading should be passed. The least significant bit of each 32-bit word
represents the lowest file number in the word. The first word contains the
bits for the first 32 files. Subsequent words contain the bits for additional
groups of 32 files.
For each file number less than
numfiles
, the corresponding bit in the
mask is set at return if the bit was set at entry and the file is ready for
reading.