The following programs work well. Is there any conditions?
cc -xCC -G -D_POSIX_C_SOURCE=199506L sub1.c -o libsub1.so -lpthread
cc dltest.c -ldl
-- dltest.c --------------------------------
main() {
void * hd1;
int (*fptr1)(void);
if(!(hd1=dlopen("libsub1.so",RTLD_NOW)))
printf("dlopen %s\n",dlerror());
if(!(fptr1=(int(*)())dlsym(hd1,"sub1")))
printf("dlsym %s\n",dlerror());
(*fptr1)();
}
-- sub1.c ---------------------------------
sub1() {
return 0;
}
-----------------------------------------
Thank you,
Enokida
Sent: Wednesday, February 21, 2007 4:55 PM
Subject: Re: [osol-code] Any problems with providing only shared librarys linked with libpthread.so
For releases of Solaris prior to 10, this is not supported. In
particular, dlopenning libraries that are thread-hot from non-mt safe
programs is known not to work well.
I think it's even worse: even if a program is compiled MT-safe, then
it still can't open libraries which start threads because some things
get confused.
Casper
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code