From owner-cvs-all Thu Nov 22 15:52:48 2001 Delivered-To: cvs-all@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 7310337B405; Thu, 22 Nov 2001 15:52:42 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id KAA28567; Fri, 23 Nov 2001 10:52:35 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01KB1HC0YQE8VFBT6J@cim.alcatel.com.au>; Fri, 23 Nov 2001 10:52:30 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id fAMNqWp84637; Fri, 23 Nov 2001 10:52:32 +1100 Content-return: prohibited Date: Fri, 23 Nov 2001 10:52:32 +1100 From: Peter Jeremy Subject: Re: cvs commit: src/share/man/man1 builtin.1 src/bin/sh Makefile builtins.def sh.1 src/usr.bin/printf printf.1 In-reply-to: <200111221012.fAMACqN35344@grimreaper.grondar.org>; from mark@grondar.za on Thu, Nov 22, 2001 at 10:12:52AM +0000 To: Mark Murray Cc: Bruce Evans , Sheldon Hearn , Akinori MUSHA , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Mail-Followup-To: Mark Murray , Bruce Evans , Sheldon Hearn , Akinori MUSHA , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Message-id: <20011123105232.Q94635@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <20011122015842.T9998-100000@delplex.bde.org> <200111221012.fAMACqN35344@grimreaper.grondar.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2001-Nov-22 10:12:52 +0000, Mark Murray wrote: >> The bloat in /bin/sh has very little to do with having printf in it. >> It has grown from 90K text in FreeBSD-1 to 590K text today. It is >> now 50% larger than the 3.5-year old bash-1 that I normally use. >> Most of the bloat is in libraries, mostly for getpwnam() (a null >> program statically linked to getpwnam() has size 300K text). >> getpwnam() is used solely for expansion of "~". This feature was >> left out of FreeBSD-1 to save 50K or so (getpwnam() was much less >> bloated in FreeBSD-1). > >You may be able to get getpwnam() a lot smaller by building without >YP (AKA NIS). As I see it, the options are: 1) Accept the bloat - which is probably OK except for PicoBSD and the install/fixit floppies where space is at a premium. 2) Drop the ability to do '~' expansion. 3) Have a small statically linked shell in /bin and an "all the bells and whistles" version in /usr/bin. 4) Arrange /bin/sh to dynamically load /usr/lib/libc.so if it's available when getpwnam() is called, otherwise use a staticly linked version that only uses /etc/passwd. Option 4 would seem to solve the bloat problem without losing the ability to ~-expand a YP username. (And if /usr isn't mounted, there's a reasable likelihood that the network isn't up so YP isn't available anyway). I'm less certain how practical this is since it requires the ability to try to dynamically link a library from an otherwise static executable when neither the library nor the loader may be available. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message