Subject: shared libs... what am I doing wrong
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Peter Galbavy <peter@alice.wonderland.org>
List: current-users
Date: 08/17/1994 22:45:48
I am currently hacking at ISODE in the background, and getting it
compiling etc. I have got as far a a libisode.a and a shared version
of it. However, I am having problems with using the shared lib.
When linked shared I get bus error in fseek(), but when linked
statically all is OK. I suspect I am not treating globals correctly.
Is there anything special I have to do ?
The offending code looks like:
static char *isoservices = "isoservices";
static FILE *servf = NULL;
static int stayopen = 0;
static struct isoservent iss;
/* */
int setisoservent (f)
int f;
{
if (servf == NULL)
servf = fopen (isodefile (isoservices, 0), "r");
else
rewind (servf);
stayopen |= f;
return (servf != NULL);
}
And the bus error is in the fseek, called by rewind etc. I guess
I should be doing something with the statics ? The link line is
from <bsd.lib.mk>, so I guess it's OK.
This is all on NetBSD/sparc 1.0_BETA. As of about 3 weeks ago.
Ignorantly yours :)
--
Peter Galbavy work: peter@demon.co.uk
Wonderland rest: peter@wonderland.org
play: http://www.wonderland.org/
"The 'net interprets censorship as damage and routes around it." - John Gilmore
------------------------------------------------------------------------------