Subject: Re: PROPOSAL: removal of brk()/sbrk().
To: <>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 02/26/2002 22:40:15
David Laight wrote:
> On Tue, Feb 26, 2002 at 11:29:43AM +1100, Darren Reed wrote:
> >
> > Some things out there use sbrk() as the foundation of their own
> > application's malloc() and siply removing sbrk() from libc will
> > affect being able to compile them, never mind running them.
>
> ISTR one of the common shells worked this way. Indeed it waited
> for the fault and had a signal handler that extended the data
> area.
The original Bourne shell does this. I don't know if the reason was that
it pre-dated malloc(3) or was meant to be as lean as possible.
And lean it certainly is. A static Bourne shell binary on a 1.5 alpha
is only a tad over 49kB - the only static binary in the distribution
smaller than that is /bin/sync.
[ Yes, people are probably sick of me mentioning this once a year or
so, but the size of this program still amazes me, as does the fact
that it works flawlessly on a 64bit system. ]
Simon.
--
Simon Burge <simonb@wasabisystems.com>
NetBSD CDs, Support and Service: http://www.wasabisystems.com/