<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: dlsym is not working old VMS in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517396#M42989</link>
    <description>It is always goo to check the return code. But be aware, that dlopen() on VMS just creates and returns the handle. It will neither open the file nor check if it can be found anywhwere. dlsym calls lib$fis and then the file is searched for activation and accessed for the symbols. This is documented behavior.&lt;BR /&gt;</description>
    <pubDate>Tue, 20 Oct 2009 15:14:23 GMT</pubDate>
    <dc:creator>H.Becker</dc:creator>
    <dc:date>2009-10-20T15:14:23Z</dc:date>
    <item>
      <title>dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517392#M42985</link>
      <description>Hello.&lt;BR /&gt;There is VAX system with OpenVMS 7.2&lt;BR /&gt;&lt;BR /&gt;There are three files:&lt;BR /&gt;&lt;BR /&gt;*******************&lt;BR /&gt;TEST:  shareable image&lt;BR /&gt;*******************&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;test()&lt;BR /&gt;{&lt;BR /&gt; printf("test\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;*******************&lt;BR /&gt;MAIN:&lt;BR /&gt;*******************&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;DLFCN.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  void *h;&lt;BR /&gt;  void (*func);&lt;BR /&gt;&lt;BR /&gt;  h=dlopen("TEST.EXE",0);&lt;BR /&gt;  func = dlsym(h,"TEST");&lt;BR /&gt;  if (func==NULL) printf("Error\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;****************&lt;BR /&gt;OPT.OPT&lt;BR /&gt;****************&lt;BR /&gt;UNIVERSAL=TEST&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Compiling:&lt;BR /&gt;CC MAIN&lt;BR /&gt;LINK MAIN&lt;BR /&gt;CC TEST&lt;BR /&gt;LINK/SHARE=TEST TEST,TEST/OPT&lt;BR /&gt;&lt;BR /&gt;RU MAIN&lt;BR /&gt;Error.&lt;BR /&gt;What I'm doing wrong?&lt;BR /&gt;&lt;BR /&gt;P.S.&lt;BR /&gt;ANALIZ/IM shows me TEST symbol ok.&lt;BR /&gt;&lt;/DLFCN.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 20 Oct 2009 11:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517392#M42985</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2009-10-20T11:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517393#M42986</link>
      <description>Next experiment:&lt;BR /&gt;&lt;BR /&gt;************************&lt;BR /&gt;main1&lt;BR /&gt;************************&lt;BR /&gt;#define __NEW_STARLET 1&lt;BR /&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;DESCRIP.H&gt;&lt;BR /&gt;#include &lt;SSDEF.H&gt;&lt;BR /&gt;#include &lt;STSDEF.H&gt;&lt;BR /&gt;#include &lt;LIB&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/*&lt;BR /&gt;** Set up some macros to make the declaration of a variable string easy.&lt;BR /&gt;*/&lt;BR /&gt;#define MAX_LEN 250&lt;BR /&gt;&lt;BR /&gt;#define VS_STRING(name, len) \&lt;BR /&gt;struct { \&lt;BR /&gt;    unsigned short length; \&lt;BR /&gt;    char string[len]; \&lt;BR /&gt;    struct dsc$descriptor_vs desc; \&lt;BR /&gt;} name = {0, "", {len, DSC$K_DTYPE_VT, DSC$K_CLASS_VS, (char*)&amp;amp;name.length}}&lt;BR /&gt;&lt;BR /&gt;#define STRING(name) VS_STRING(name, MAX_LEN)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;static int edit_routine;&lt;BR /&gt;&lt;BR /&gt;static unsigned long int r0_status;&lt;BR /&gt;static unsigned int arg_list[4];&lt;BR /&gt;&lt;BR /&gt;static $DESCRIPTOR (filename_d, "TEST.EXE");&lt;BR /&gt;static $DESCRIPTOR (symbol_d, "TEST");&lt;BR /&gt;&lt;BR /&gt;static STRING (instring);&lt;BR /&gt;static STRING (outstring);&lt;BR /&gt;&lt;BR /&gt;    r0_status = lib$find_image_symbol (&amp;amp;filename_d,                                       &amp;amp;symbol_d,                                       &amp;amp;edit_routine,&lt;BR /&gt;                                       0,&lt;BR /&gt;                                       0);&lt;BR /&gt;    instring.length = sprintf (instring.string, "test 1 2 3");&lt;BR /&gt;&lt;BR /&gt;    /*&lt;BR /&gt;    ** Set up the argument list for lib$callg().  32 means "uppercase the&lt;BR /&gt;    ** input string".  For the BASIC programmers, I'm desperate to code it&lt;BR /&gt;    ** as "32%", but I'll resist ;-)&lt;BR /&gt;    */&lt;BR /&gt;    arg_list[0] = 3;&lt;BR /&gt;    arg_list[1] = (unsigned long int)&amp;amp;outstring.desc;&lt;BR /&gt;    arg_list[2] = (unsigned long int)&amp;amp;instring.desc;&lt;BR /&gt;    arg_list[3] = 32;&lt;BR /&gt;&lt;BR /&gt;    /*&lt;BR /&gt;    ** Call the routine whose address we found.&lt;BR /&gt;    */&lt;BR /&gt;    r0_status = lib$callg (arg_list,&lt;BR /&gt;                           (int (*)())edit_routine);&lt;BR /&gt;    //errchk_sig (r0_status);&lt;BR /&gt;&lt;BR /&gt;    /*&lt;BR /&gt;    ** Show we really did the business.  Note "test" should now be upper&lt;BR /&gt;    ** case.&lt;BR /&gt;    */&lt;BR /&gt;    (void)printf ("%-.*s\n",&lt;BR /&gt;                  outstring.length,&lt;BR /&gt;                  outstring.desc.dsc$a_pointer+2);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;It is not working too.&lt;BR /&gt;"invalid logical name" when call LIB$FIND_IMAGE_SYMBOL&lt;BR /&gt;&lt;BR /&gt;&lt;/LIB&gt;&lt;/STSDEF.H&gt;&lt;/SSDEF.H&gt;&lt;/DESCRIP.H&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Tue, 20 Oct 2009 11:50:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517393#M42986</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2009-10-20T11:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517394#M42987</link>
      <description>Alex,&lt;BR /&gt;I think the shareable must be put in SYS$SHARE for LIB$FIND_IMAGE_SYMBOL to work, or use a logical name to point to the image.&lt;BR /&gt;Regards,&lt;BR /&gt;Kris (aka Qkcl)</description>
      <pubDate>Tue, 20 Oct 2009 12:43:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517394#M42987</guid>
      <dc:creator>Kris Clippeleyr</dc:creator>
      <dc:date>2009-10-20T12:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517395#M42988</link>
      <description>One thing for sure:&lt;BR /&gt;test the return value of dlopen(), it certainly will show NULL:&lt;BR /&gt;dlopen("TEST.EXE",0) will search for sys$share:TEST.EXE.&lt;BR /&gt;Either specify the full file specification in the dlopen call, or -better- define a logical name like &lt;BR /&gt;define TESTSHR sys$disk;[]TEST.EXE,&lt;BR /&gt;and then dlopen("TESTSHR",0);&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 12:47:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517395#M42988</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2009-10-20T12:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517396#M42989</link>
      <description>It is always goo to check the return code. But be aware, that dlopen() on VMS just creates and returns the handle. It will neither open the file nor check if it can be found anywhwere. dlsym calls lib$fis and then the file is searched for activation and accessed for the symbols. This is documented behavior.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Oct 2009 15:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517396#M42989</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2009-10-20T15:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517397#M42990</link>
      <description>&lt;!--!*#--&gt;"&lt;BR /&gt;But be aware, that dlopen() on VMS just creates and returns the handle. It will neither open the file nor check if it can be found anywhwere.&lt;BR /&gt;"&lt;BR /&gt;&lt;BR /&gt;No, Hartmut, dlopen() does more than that :-) Just run the attached program.&lt;BR /&gt;&lt;BR /&gt;-Boris&lt;BR /&gt;&lt;BR /&gt;x.c&lt;BR /&gt;---&lt;BR /&gt;#include &lt;DLFCN.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;#define TEST(N, IMAGE) \&lt;BR /&gt;  if ( !dlopen(IMAGE, RTLD_LAZY) ) \&lt;BR /&gt;    printf(#N ") %s\n", dlerror()); \&lt;BR /&gt;  else \&lt;BR /&gt;    puts(#N ") success");&lt;BR /&gt;&lt;BR /&gt;int main() {&lt;BR /&gt;  TEST(1, "decc$shr");&lt;BR /&gt;  TEST(2, "decc$shrxyz");&lt;BR /&gt;  TEST(3, "sys$login:login.com");&lt;BR /&gt;}&lt;/STDIO.H&gt;&lt;/DLFCN.H&gt;</description>
      <pubDate>Tue, 20 Oct 2009 18:33:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517397#M42990</guid>
      <dc:creator>WW304289</dc:creator>
      <dc:date>2009-10-20T18:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517398#M42991</link>
      <description>Hi Boris,&lt;BR /&gt;You are right and I was wrong. I wonder how this was implemented :-) Now we need someone to fix HELP CRTL dlopen Description: "...This function does not load a shareable image but rather saves...&lt;BR /&gt;&lt;BR /&gt;Hartmut</description>
      <pubDate>Wed, 21 Oct 2009 07:14:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517398#M42991</guid>
      <dc:creator>H.Becker</dc:creator>
      <dc:date>2009-10-21T07:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: dlsym is not working old VMS</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517399#M42992</link>
      <description>Thank you very much for all, for your help.&lt;BR /&gt;Yesterday I find the same solution.&lt;BR /&gt;I've defined the name of shareable image via DEFINE and open it succesfully.&lt;BR /&gt;&lt;BR /&gt;Also, shareable images should be built without ANY WARNINGS. It seems, this *bug* is in 7.3-1 and earlier.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Working since 7.3-2 that works with filenames without logical names, I forget about this feature :)&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Oct 2009 08:57:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/dlsym-is-not-working-old-vms/m-p/4517399#M42992</guid>
      <dc:creator>Alex Chupahin</dc:creator>
      <dc:date>2009-10-21T08:57:48Z</dc:date>
    </item>
  </channel>
</rss>

