Date: Fri, 28 Oct 2005 01:27:11 -0700 (PDT) From: Rob <spamrefuse@yahoo.com> To: Igor Robul <igorr@speechpro.com>, FreeBSD questions <freebsd-questions@freebsd.org> Subject: Re: math/grace port: "libXcursor.so.1.0" not found ?? [SOLVED] Message-ID: <20051028082711.18912.qmail@web36214.mail.mud.yahoo.com> In-Reply-To: <4361DCA6.7030201@speechpro.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--- Igor Robul <igorr@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051028082711.18912.qmail>