sbrk(2) broken

Igor Mozolevsky igor at hybrid-lab.co.uk
Mon Jan 7 16:06:35 PST 2008


On 07/01/2008, Andrew Reilly <andrew-freebsd at areilly.bpc-users.org> wrote:
> On Mon, 07 Jan 2008 13:18:47 +0000
> "Poul-Henning Kamp" <phk at phk.freebsd.dk> wrote:
>
> > Yes, but you will not see this complication, it will be hidden
> > in the implementation of malloc(3).
>
> How could you hide it inside malloc?  Would malloc start
> returning 0 after receiving the "less mem than desirable"
> signal?  Would it ever go back to returning non-zero?

I'm with Andrew on this one. The only (sensible) way I could see it
being hidden behind malloc() is if malloc() blocks until sufficient
memory becomes available.

I thought the real idea behind SIGDANGER was to tell the kernel "I
kind of know what I'm doing, so if you gonna kill something don't kill
me" and that was achieved by AIX not SIGKILLing processes that had
sigaction(SIGDANGER) != SIG_IGN.

Igor :-)


More information about the freebsd-current mailing list