From owner-freebsd-arch@FreeBSD.ORG Thu May 1 08:35:00 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 E671237B401; Thu, 1 May 2003 08:35:00 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28EC843FA3; Thu, 1 May 2003 08:35:00 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h41FYvBg012699; Thu, 1 May 2003 11:34:57 -0400 (EDT) Received: from localhost (eischen@localhost)h41FYvjA012694; Thu, 1 May 2003 11:34:57 -0400 (EDT) Date: Thu, 1 May 2003 11:34:57 -0400 (EDT) From: Daniel Eischen To: "Andrey A. Chernov" In-Reply-To: <20030501151458.GA54182@nagual.pp.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 15:35:01 -0000 On Thu, 1 May 2003, Andrey A. Chernov wrote: > On Thu, May 01, 2003 at 09:53:45 -0500, Jacques A. Vidrine wrote: > > > > A libc consumer (getpwent.c): > > 587 namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1); > > IMHO, it is bad hack at whole, and all namespace.h tricks should be > removed. > > The reason is quite simple. Yes, you can save libc this way, but what > happens, if application linked, say, with libc AND libncurses (insert any > other system library here)? libc will be saved, but libncurses will not. > It means, to be logically, you need to replace strlcpy with _strlcpy in > ALL FreeBSD libraries. Better way is stop doing half-singing - > half-dancing and produce linker error when application attempts to replace > any function in standard namespace. It automatically makes impossible > broken binary-only packages. > > So, I vote for namespace.h removing (i.e. all _ tricks). Who with me? Wrong. We need _ tricks for threads libraries to work properly and was the reason it was added in the first place. BDE came up with the idea and it was reviewed by him. People developing and modifying libc need to be aware of the requirements of the threads libraries. Libc isn't in its own little world anymore; it has to play along nicely with others. Sure, you can debate strlcpy/strlcat if you want, but please don't remove things that need to be there (in [un-]namespace.h). -- Dan Eischen