Subject: m_get(), MGET(), and MGETHDR() with M_WAIT
To: None <tech-kern@NetBSD.ORG>
From: Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu>
Date: 06/05/1996 15:04:42
So, looking through the kernel I noticed that the treatment of
uses of m_get(), MGET() and MGETHDR() with the M_WAIT flag is
In particular, some uses check the return value against NULL, lots
of places don't, and some do things that are ... odd.
By file which uses one of the above functions/macros with M_WAIT:
(all == all returns checked, none == none checked, etc.)
compat/hpux/hpux_net.c all, but some probably buggy
nfs/krpc_subr.c some, and some buggy
In the current implementation, none of those functions/macros will
ever return NULL if used with M_WAIT.
What i'm wondering is, in their 'well-documented' definitions, are
they ever allowed to return NULL in that case?
If so, a lot more return-checking code should probably be added (or at
least, it should be noted that it may be needed). If not, the
existing return-checking code should be tossed...
The problem is, I can't find any 'good documentation' for them. the
4.3 daemon book doesn't cover them in detail, and I don't currently
have access to a copy of the 4.4 daemon book (and, given the 4.3
book's coverage, i doubt that it would include the details that I
Anybody know the answer?