ADIC Server Server User Manual


 
Response Technique 5-21
21 Dec 2001
Response Technique
This section describes the most desirable response processing
technique.
Setup
The following code should be executed upon startup. This
code installs a signal handler, which will be automatically run
every time one of the child processes terminates. At this point
retrieve the results, place them into internal data structures
and free the shared memory array entry. See Figure 5-21.
Figure 5-21 Setup Signal Handler
. . .
/* dasadmin sample application, dasadmin.c file */
int ( *func )();
struct sigaction action;
aci_async_entry *async_entry;
action.sa_handler = wait_for_child;
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGCHLD, &action, (struct sigaction*)0)
== (int)SIG_ERR)
{
fprintf( stderr, "Unable to set signal handler for
SIGCHLD\n");
return( 1 );
}
. . .