FTAM/9000 Programmer's Guide
188 Chapter 4
Using Support Functions
Responding to Asynchronous Calls
Using em_hp_sigio()
#include %</opt/ftam/include/map.h>
Return_code
em_hp_sigio (action, pid, result)
Unit32 action;
Sint32 pid;
Api_rc *result;
This section describes how to use em_hp_select() and provides a program
example. For additional details, refer to the HP FTAM/9000 Reference
Manual.
Use em_hp_sigio() to enable the MAP Event Management interface to
generate SIGIO signals whenever an asynchronous MAP event is
pending. Unlike the other MAP event management functions,
em_hp_sigio() does not return a MAP event to the caller. Instead, it
merely puts the MAP event management interface into an extended
capability mode.
By using this capability, you can suspend the processing of your
application until any of a variety of signals or semaphore operations
cause your application to resume execution. Then, only after the SIGIO
signal has been received do you need to call em_wait() to obtain the MAP
event that is pending. Furthermore, since you know the MAP event is
already pending, you can call em_wait() with a zero timeout to obtain the
event and return immediately.
The following program example illustrates one possible use of
em_hp_sigio(). The program initiates and processes two types of events:
MAP events in the form of FTAM and/or FTAM asynchronous
operations, and Non-MAP events that take the form of SIGUSR1 signals.
The em_hp_sigio() function is used to enable SIGIO signal notiļ¬cation in
the MAP Event Management interface, and em_wait() is used to process
the MAP event after SIGIO is caught.