- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: dlsym is not working old VMS
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
The article you are trying to access is permanently deleted.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 04:26 AM
тАО10-20-2009 04:26 AM
There is VAX system with OpenVMS 7.2
There are three files:
*******************
TEST: shareable image
*******************
#include
test()
{
printf("test\n");
}
*******************
MAIN:
*******************
#include
#include
#include
main()
{
void *h;
void (*func);
h=dlopen("TEST.EXE",0);
func = dlsym(h,"TEST");
if (func==NULL) printf("Error\n");
}
****************
OPT.OPT
****************
UNIVERSAL=TEST
Compiling:
CC MAIN
LINK MAIN
CC TEST
LINK/SHARE=TEST TEST,TEST/OPT
RU MAIN
Error.
What I'm doing wrong?
P.S.
ANALIZ/IM shows me TEST symbol ok.
Solved! Go to Solution.
- Tags:
- dlsym
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 04:50 AM
тАО10-20-2009 04:50 AM
Re: dlsym is not working old VMS
************************
main1
************************
#define __NEW_STARLET 1
#include
#include
#include
#include
#include
#include
/*
** Set up some macros to make the declaration of a variable string easy.
*/
#define MAX_LEN 250
#define VS_STRING(name, len) \
struct { \
unsigned short length; \
char string[len]; \
struct dsc$descriptor_vs desc; \
} name = {0, "", {len, DSC$K_DTYPE_VT, DSC$K_CLASS_VS, (char*)&name.length}}
#define STRING(name) VS_STRING(name, MAX_LEN)
main()
{
static int edit_routine;
static unsigned long int r0_status;
static unsigned int arg_list[4];
static $DESCRIPTOR (filename_d, "TEST.EXE");
static $DESCRIPTOR (symbol_d, "TEST");
static STRING (instring);
static STRING (outstring);
r0_status = lib$find_image_symbol (&filename_d, &symbol_d, &edit_routine,
0,
0);
instring.length = sprintf (instring.string, "test 1 2 3");
/*
** Set up the argument list for lib$callg(). 32 means "uppercase the
** input string". For the BASIC programmers, I'm desperate to code it
** as "32%", but I'll resist ;-)
*/
arg_list[0] = 3;
arg_list[1] = (unsigned long int)&outstring.desc;
arg_list[2] = (unsigned long int)&instring.desc;
arg_list[3] = 32;
/*
** Call the routine whose address we found.
*/
r0_status = lib$callg (arg_list,
(int (*)())edit_routine);
//errchk_sig (r0_status);
/*
** Show we really did the business. Note "test" should now be upper
** case.
*/
(void)printf ("%-.*s\n",
outstring.length,
outstring.desc.dsc$a_pointer+2);
}
It is not working too.
"invalid logical name" when call LIB$FIND_IMAGE_SYMBOL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 05:43 AM
тАО10-20-2009 05:43 AM
SolutionI 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.
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 05:47 AM
тАО10-20-2009 05:47 AM
Re: dlsym is not working old VMS
test the return value of dlopen(), it certainly will show NULL:
dlopen("TEST.EXE",0) will search for sys$share:TEST.EXE.
Either specify the full file specification in the dlopen call, or -better- define a logical name like
define TESTSHR sys$disk;[]TEST.EXE,
and then dlopen("TESTSHR",0);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 08:14 AM
тАО10-20-2009 08:14 AM
Re: dlsym is not working old VMS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-20-2009 11:33 AM
тАО10-20-2009 11:33 AM
Re: dlsym is not working old VMS
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.
"
No, Hartmut, dlopen() does more than that :-) Just run the attached program.
-Boris
x.c
---
#include
#include
#define TEST(N, IMAGE) \
if ( !dlopen(IMAGE, RTLD_LAZY) ) \
printf(#N ") %s\n", dlerror()); \
else \
puts(#N ") success");
int main() {
TEST(1, "decc$shr");
TEST(2, "decc$shrxyz");
TEST(3, "sys$login:login.com");
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2009 12:14 AM
тАО10-21-2009 12:14 AM
Re: dlsym is not working old VMS
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...
Hartmut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2009 01:57 AM
тАО10-21-2009 01:57 AM
Re: dlsym is not working old VMS
Yesterday I find the same solution.
I've defined the name of shareable image via DEFINE and open it succesfully.
Also, shareable images should be built without ANY WARNINGS. It seems, this *bug* is in 7.3-1 and earlier.
Working since 7.3-2 that works with filenames without logical names, I forget about this feature :)