Date: Sat, 08 May 1999 10:34:18 -0600 From: Warner Losh <imp@harmony.village.org> To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> Cc: current@FreeBSD.ORG Subject: Re: m_get(M_WAIT, ...) _can_ return NULL ? Message-ID: <199905081634.KAA14466@harmony.village.org> In-Reply-To: Your message of "Sat, 08 May 1999 15:32:33 %2B0200." <199905081332.PAA07452@labinfo.iet.unipi.it> References: <199905081332.PAA07452@labinfo.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905081634.KAA14466>