AIX operating systemsLinux operating systemsHP-UX operating systemsOracle Solaris operating systems

Sample user-exit program

userExitSample.c is a sample user-exit program invoked by the server.

Figure 1. Sample user exit program
/***********************************************************************
 * Name:            userExitSample.c
 * Description:     Example user-exit program invoked by the server
 * Environment:     AIX operating systemsAIX 4.1.4+ on RS/6000HP-UX operating systemsHP-UXLinux operating systemsLinux/i386Oracle Solaris operating systemsSolaris
 ***********************************************************************/
 
#include <stdio.h>
#include "userExitSample.h"
 
/**************************************
 *** Do not modify below this line. ***
 **************************************/
 
extern void adsmV3UserExit( void *anEvent );
 
/************
 *** Main ***
 ************/
 
int main(int argc, char *argv[])
{
/* Do nothing, main() is never invoked, but stub is needed */
 
exit(0);  /* For picky compilers */
 
} /* End of main() */
 
/******************************************************************
 * Procedure:  adsmV3UserExit
 * If the user-exit is specified on the server, a valid and
 * appropriate event causes an elEventRecvData structure (see
 * userExitSample.h) to be passed to adsmV3UserExit that returns a void.
 * INPUT :   A (void *) to the elEventRecvData structure
 * RETURNS:  Nothing
 ******************************************************************/
 
void adsmV3UserExit( void *anEvent )
{
/* Typecast the event data passed */
elEventRecvData *eventData = (elEventRecvData *)anEvent;

/**************************************
 *** Do not modify above this line. ***
 **************************************/
 
if( ( eventData->eventNum == USEREXIT_END_EVENTNUM     ) ||
    ( eventData->eventNum == END_ALL_RECEIVER_EVENTNUM ) )
  {
   /* Server says to end this user-exit.  Perform any cleanup, *
    * but do NOT exit() !!!                                    */
   return;
  }
 
/* Field Access:  eventData->.... */
/* Your code here ... */
 
/* Be aware that certain function calls are process-wide and can cause
 * synchronization of all threads running under the TSM Server process!
 * Among these is the system() function call.  Use of this call can
 * cause the server process to hang and otherwise affect performance.
 * Also avoid any functions that are not thread-safe.  Consult your
 * system's programming reference material for more information.
*/

return; /* For picky compilers */
} /* End of adsmV3UserExit() */