Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Sun, 18 Apr 2004 @ 08:47:50 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Notify Exit with BTEQ
 
From:   Anomy Anom

<-- Anonymously Posted: Sunday, April 18, 2004 00:17 -->

Try calling the notify exit routine directly by using a program that does a dlopen() on a shared library. Use the dlerror() and errno to get more information on why BTEQ is unable to load the shared object in your case. Debugging the exit routine should also be much easier this way. Here is an example program that loads the shared object. We run Solaris 5.6, and a very old version of TUF. This program has no problems invoking the notify exit routine.

     /* Wrapper.c ext for btnfyext */
     #include 
     #include 
     #include 

     int main(int argc, char **argv)
     {

         void *handle;
         long (*fptr)(BTNotifyExitParm *p);
         const char *error;
         extern int errno;
         long rc;
         BTNotifyExitParm parms;
         char str[] = "Notify invoked";

         handle = dlopen("btnfyext", RTLD_NOW);

         if (handle == NULL)
         {
            printf("Error %s %d\n", dlerror(),errno);
            exit(1);
         }

         *(void **)(&fptr) = dlsym(handle, "_dynamn");
         if ((error = dlerror()) != NULL)
         {
            printf("Error in dlsym %s errno = %d\n", error, errno);
            exit(1);
         };
         printf("Calling btnfyext Exit routine\n");
         /* Call the notify routine with some event. */
         parms.Event    = NBEventReqStart;
         parms.Vals.ReqStart.Request = str;
         rc = (*fptr)(&parms);
         printf("Successfully called btnfyext Exit routine\n");

         dlclose(handle);

         return 0;
     }

Build using " cc wrapper.c -ldl"

Remember to set LD_LIBRARY_PATH correctly so that this program can locate the exit routine.


Hope this helps.

Thanks



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023