From owner-freebsd-hackers Wed Jan 28 17:11:40 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA06933 for hackers-outgoing; Wed, 28 Jan 1998 17:11:40 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA06866 for ; Wed, 28 Jan 1998 17:11:32 -0800 (PST) (envelope-from jdp@austin.polstra.com) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.8.8/8.8.8) with ESMTP id RAA01481; Wed, 28 Jan 1998 17:11:29 -0800 (PST) (envelope-from jdp) Message-Id: <199801290111.RAA01481@austin.polstra.com> To: Nate Williams cc: hackers@FreeBSD.ORG Subject: Re: dladdr: Hel-lo-o-o? In-reply-to: Your message of "Wed, 28 Jan 1998 17:57:25 MST." <199801290057.RAA07509@mt.sri.com> Date: Wed, 28 Jan 1998 17:11:28 -0800 From: John Polstra Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > haven't received a single report. Grrrrr. > > I've tried the patches, and they are indeed running on my 2.2.5 > system. And, yes you did receive a single report pointing out a bug > in the patch. :) Well, besides that one. :-} > Is there an easy way for me to figure out how to check to see if it > exists so that I can support both old and new systems? For a compile time check: #include #ifdef LDSO_VERSION_HAS_DLADDR ... #endif I think a run time check should be possible, too, though I haven't tried it for this particular case: struct dl_info; #pragma weak dladdr extern int dladdr(void *, struct dl_info *); if (&dladdr == 0) /* It's not available. */ else /* It is available. */ Don't ya just love it? If gcc tries to get too smart with you, you might need to obfuscate the "&dladdr == 0" part. Gcc might try to assume that the address of a global can't possibly be zero. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth