From owner-freebsd-stable@FreeBSD.ORG Thu Jul 24 10:34:39 2003 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3A6F37B401 for ; Thu, 24 Jul 2003 10:34:39 -0700 (PDT) Received: from msgbas1x.cos.agilent.com (msgbas1x.cos.agilent.com [192.25.240.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 335E043F93 for ; Thu, 24 Jul 2003 10:34:39 -0700 (PDT) (envelope-from darrylo@soco.agilent.com) Received: from relcos1.cos.agilent.com (relcos1.cos.agilent.com [130.29.152.239]) by msgbas1x.cos.agilent.com (Postfix) with ESMTP id 6A67716AB0 for ; Thu, 24 Jul 2003 11:34:36 -0600 (MDT) Received: from mina.soco.agilent.com (mina.soco.agilent.com [141.121.54.157]) by relcos1.cos.agilent.com (Postfix) with ESMTP id 7709FC8 for ; Thu, 24 Jul 2003 11:34:38 -0600 (MDT) Received: from mina.soco.agilent.com (darrylo@localhost [127.0.0.1]) SMKit7.1.1_Agilent) with ESMTP id KAA04726 for ; Thu, 24 Jul 2003 10:34:38 -0700 (PDT) Message-Id: <200307241734.KAA04726@mina.soco.agilent.com> To: freebsd-stable@freebsd.org In-Reply-To: Your message of "Thu, 24 Jul 2003 16:49:34 +1000." <3F1F817E.7040504@bigpond.net.au> Mime-Version: 1.0 (generated by tm-edit 1.7) Content-Type: text/plain; charset=US-ASCII Date: Thu, 24 Jul 2003 10:34:37 -0700 From: Darryl Okahata Subject: Re: malloc does not return null when out of memory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Darryl Okahata List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jul 2003 17:34:40 -0000 Andrew Reilly wrote: > Mike Tancsa wrote: > > >> Ah, the annual "memory overcommit" thread. I thought we were overdue > >> for one. > > > > But why does the man page for malloc (3) say, > > > > If malloc() fails, a NULL pointer is returned. > > Because that's what happens. See the subthread with the ulimit examples. You know, we could probably eliminate many of these periodic "why doesn't malloc() return NULL?" threads by simply enhancing the malloc(3) man page and adding a FAQ entry. -- Darryl Okahata darrylo@soco.agilent.com DISCLAIMER: this message is the author's personal opinion and does not constitute the support, opinion, or policy of Agilent Technologies, or of the little green men that have been following him all day.