math/grace port: "libXcursor.so.1.0" not found ?? [SOLVED]

Rob spamrefuse at yahoo.com
Fri Oct 28 01:27:12 PDT 2005



--- Igor Robul <igorr at speechpro.com> wrote:

> Rob wrote:
> 
> >>
> >>The dlsym() function returns a null pointer if the
> >>symbol cannot be 
> >>found, and sets an error condition
> >> which may be queried with dlerror().
> >>    
> >>
> >
> >This is a matter of symantic and logic.
> >
> >I /can/ read this as follows:
> >
> >If the symbol cannot be found, then dlsym() returns
> >a null pointer *AND* sets the error condition.
> >  
> >
> Ok, English is not my native language, and I even
> had not learned it in 
> school :-).

Neither is it for me, though I had some English
language classes at high school.
However, I assume everybody to understand the
language of logic and symantics when it comes to
computer problems :).

> >However, dlsym() can also return the null pointer,
> >*WITHOUT* setting the error condition. The latter
> >case seems to be better specified in the Linux
> >manpages of dlsym(). Hence the conflict between
> >FreeBSD and Linux/Grace, I guess.
> >  
> >
> Maybe. But I see conflict in using
> previous/non-grace result from dlerror(), which
> I think grace should not do.

Indeed, so the proper way is to call dlerror()
prior to a dlsym() call, to reset any previous
error condition. Something like this:

  /* clear error condition */
  dlerror();

  /* use dlsym and check for error */
  data = dlsym(....);
  if ( (error = dlerror()) != NULL ) {
      errmsg(error);
      return FAILURE;
  }


Rob.



		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com


More information about the freebsd-questions mailing list