From owner-freebsd-arch@FreeBSD.ORG Thu May 1 07:53:48 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 578AE37B401 for ; Thu, 1 May 2003 07:53:48 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 75EBC43FA3 for ; Thu, 1 May 2003 07:53:47 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id B42DA50; Thu, 1 May 2003 09:53:46 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id 0E8A578C4A; Thu, 1 May 2003 09:53:46 -0500 (CDT) Date: Thu, 1 May 2003 09:53:45 -0500 From: "Jacques A. Vidrine" To: Paul Richards Message-ID: <20030501145345.GA34884@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Paul Richards , freebsd-arch@FreeBSD.org References: <20030430043303.GA46365@mero.morphisms.net> <20030430062647.GA82023@rot13.obsecurity.org> <20030430143121.GK39658@survey.codeburst.net> <20030430152708.GA26216@madman.celabo.org> <20030430153645.GL39658@survey.codeburst.net> <20030430164135.GB26508@madman.celabo.org> <20030501140255.GB1869@survey.codeburst.net> <20030501143032.GA34163@madman.celabo.org> <20030501144600.GC1869@survey.codeburst.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030501144600.GC1869@survey.codeburst.net> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: freebsd-arch@FreeBSD.org Subject: Re: `Hiding' libc symbols (was Re: cvs commit: src/lib/libc/gen ...) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 14:53:48 -0000 On Thu, May 01, 2003 at 03:46:00PM +0100, Paul Richards wrote: [...] > > No, it is done for some 150+ functions. If the technique didn't have > > 150+? I must have missed that in the commit and subsequent discussion. See src/lib/libc/include/namespace.h . [...] > Hmm, perhaps a more correct implementation of our libc would not > use the exported interface to implement the exported interface > (thinking aloud). > > i.e. there'd be a _strlcpy that strlcpy was just a wrapper for > and internally the _strlcpy would be used. Oh, Paul. That is exactly what we are doing today. strlcpy.c: 41 __weak_reference(_strlcpy, strlcpy); 42 /* 43 * Copy src to string dst of size siz. At most siz-1 characters 44 * will be copied. Always NUL terminates (unless siz == 0). 45 * Returns strlen(src); if retval >= siz, truncation occurred. 46 */ 47 size_t _strlcpy(dst, src, siz) 48 char *dst; 49 const char *src; 50 size_t siz; 51 { A libc consumer (getpwent.c): 587 namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1); Cheers, -- Jacques Vidrine . NTT/Verio SME . FreeBSD UNIX . Heimdal nectar@celabo.org . jvidrine@verio.net . nectar@freebsd.org . nectar@kth.se