From owner-freebsd-current Sat May 8 9:35: 2 1999 Delivered-To: freebsd-current@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 8A67E1568A for ; Sat, 8 May 1999 09:34:58 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id KAA26550; Sat, 8 May 1999 10:34:09 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id KAA14466; Sat, 8 May 1999 10:34:18 -0600 (MDT) Message-Id: <199905081634.KAA14466@harmony.village.org> To: Luigi Rizzo Subject: Re: m_get(M_WAIT, ...) _can_ return NULL ? Cc: current@FreeBSD.ORG In-reply-to: Your message of "Sat, 08 May 1999 15:32:33 +0200." <199905081332.PAA07452@labinfo.iet.unipi.it> References: <199905081332.PAA07452@labinfo.iet.unipi.it> Date: Sat, 08 May 1999 10:34:18 -0600 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199905081332.PAA07452@labinfo.iet.unipi.it> Luigi Rizzo writes: : m = m_get(M_WAIT, ...) : looking at the code, it seems that m_get() _can_ return a NULL pointer : even if one specifies M_WAIT. Looking at the man page for malloc: M_WAITOK indicates that it is Ok to wait for resources. It is unconve- niently defined as 0 so care should be taken never to compare against this value directly or try to AND it as a flag. The de- fault operation is to block until the memory allocation succeeds. malloc() can only return NULL if M_NOWAIT is specified. Sounds like a bug to me. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message