EC2_$WAIT_SVC Domain/OS EC2_$WAIT_SVC
NAME
ec2_$wait_svc - wait for an eventcount trigger or asynchronous fault
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/ec2.h>
pinteger ec2_$wait_svc(
ec2_$ptr_t *ec_plist,
long *ec_vlist,
short &ec_count,
status_$t *status)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/ec2.ins.pas';
function ec2_$wait_svc(
in ec_plist: univ ec2_$ptr_list_t;
in ec_vlist: univ ec2_$val_list_t;
ec_count: integer;
out status: status_$t): pinteger;
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/ec2.ins.ftn'
integer*4 ec_plist(128), ec_vlist(128), status
integer*2 ec_satisfied, ec_count
ec_satisfied = ec2_$wait_svc(ec_plist, ec_vlist, ec_count, status)
DESCRIPTION
Ec2_$wait_svc waits until one of the eventcounts in the ec_plist reaches
its trigger value in the ec_vlist. When an eventcount reaches its
trigger value, ec2_$wait_svc returns the position in ec_plist of the
pointer to the eventcount that is satisfied. If the first eventcount in
ec_plist is satisfied, ec2_$wait_svc returns 1; if the last eventcount is
satisfied, ec2_$wait_svc returns ec_count.
Several eventcounts may have been satisfied by the time this call
returns. The value returned is the position of the eventcount with the
smallest subscript that is satisfied.
If the calling process has disabled asynchronous faults and one is
received while the process is waiting in a call to ec2_$wait_svc, then
ec2_$wait_svc will return ec2_$wait_quit.
ec_plist
An array of pointers to eventcounts. The total number of pointers
in ec_plist on any one node cannot exceed 128. The pointers in
ec_plist for system eventcounts are returned by the get_ec calls for
the manager of the eventcounts.
ec_vlist
An array of positive trigger values for each of the eventcounts in
ec_plist. Ec2_$wait_svc returns when any of the eventcounts from
ec_plist reaches its trigger value in ec_vlist.
ec_count
Number of eventcount pointers in ec_plist.
status
The completion status.
NOTES
The difference between ec2_$wait_svc and ec2_$wait or ec2_$wait_slow_io
is in how they respond to asynchronous faults. If the calling process
has disabled asynchronous faults and one is received during a call to
ec2_$wait_svc, then ec2_$wait_svc returns with ec2_$wait_quit in status.
If asynchronous faults are enabled and one is received during a call to
ec2_$wait_svc, then ec2_$wait_svc responds in the following way:
⊕ It calls the clean-up handler, if the calling process has one.
⊕ If the calling process lacks a clean-up handler but has a fault
handler, then ec2_$wait calls the fault handler. If the fault
handler returns, then ec2_$wait_svc returns to the calling pro-
cess with ec2_$wait_quit in status. (If a fault handler returns
to ec2_$wait, then ec2_$wait just resumes its wait rather than
return.)
⊕ If the calling process has neither a clean-up handler nor a fault
handler, the system aborts the calling process.
SEE ALSO
gpr_$get_ec, ios_$get_ec, ipc_$get_ec, mbx_$get_ec, pbu_$get_ec,
pfm_$enable, pfm_$inhibit, pgm_$get_ec, time_$get_ec.