From owner-freebsd-hackers Wed Dec 21 01:07:27 1994 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id BAA02161 for hackers-outgoing; Wed, 21 Dec 1994 01:07:27 GMT Received: from bsd.coe.montana.edu (bsd.coe.montana.edu [153.90.192.29]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id BAA02147; Wed, 21 Dec 1994 01:07:24 GMT Received: (nate@localhost) by bsd.coe.montana.edu (8.6.8/8.3) id MAA15371; Mon, 19 Dec 1994 12:22:04 -0700 Date: Mon, 19 Dec 1994 12:22:04 -0700 From: Nate Williams Message-Id: <199412191922.MAA15371@bsd.coe.montana.edu> X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: current@freebsd.org, hackers@freebsd.org Subject: Shared library question Cc: pk@netbsd.org Sender: hackers-owner@freebsd.org Precedence: bulk What happens in our shlib implementation when the user supplies his own version of a function that also appears in the shlib? Made up example: Let's say that the standard library has the function itoa, which is prototypes as follows: int itoa(char *retbuff, int num, int radix); But, I have a need for an application which doesn't want to allocate a buffer everytime the conversion since I'm writing the result out to the screen via a very fast implementation of print which only writes out strings and does no conversions. My version of itoa contains a static character buffer so it's prototype is: char *itoa(int num); I understand all the gotchas with the above implementation and realize that I'm asking for trouble by using the same name, but it's for explaining the problem. When my program is linked, there is library code that uses the original itoa and there is application code that uses my version of itoa. Does the program use the correct version of itoa, or does it only use my version thus screwing up the library functions? This is a big deal in the regex() function which depending on which version you use there are multiple versions of regcomp() & regexec(). With the possibility of other libraries assuming one version (libedit comes to mind) I could see lots of possibilities for strange errors if an application happens to need the older interface and still wishes to use the libedit features. Thanks for the help, Nate