From owner-freebsd-current Sat May 8 18:30:46 1999 Delivered-To: freebsd-current@freebsd.org Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (Postfix) with ESMTP id 4E8CC151CA for ; Sat, 8 May 1999 18:30:42 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id LAA13409; Sun, 9 May 1999 11:29:19 +1000 Date: Sun, 9 May 1999 11:29:19 +1000 From: Bruce Evans Message-Id: <199905090129.LAA13409@godzilla.zeta.org.au> To: imp@harmony.village.org, luigi@labinfo.iet.unipi.it Subject: Re: m_get(M_WAIT, ...) _can_ return NULL ? Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >: 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. Er, m_get != malloc M_WAIT != M_WAITOK Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message