[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: kernel malloc
man 9 malloc
Unlike its standard C library counterpart (malloc(3)), the kernel
takes two more arguments. The flags argument further qualifies
malloc()'s operational characteristics as follows:
Causes malloc() to return NULL if the request cannot be
diately fulfilled due to resource shortage. Otherwise,
malloc() may call sleep to wait for resources to be released
by other processes. If this flag is not set, malloc() will
never return NULL. Note that M_WAITOK is conveniently
to be 0, and hence maybe or'ed into the flags argument to
dicate that it's Ok to wait for resources.
----- Original Message -----
From: "Wouter Clarie" <firstname.lastname@example.org>
Sent: Friday, July 12, 2002 06:16
Subject: kernel malloc
> in malloc(9) you can find that if using kernel malloc with M_WAITOK, it
> can never return NULL. Is this true in 100% of the cases? I'm doing a
> return value check of kernelland and there are quite a few cases where the
> return value is still checked when using M_WAITOK.
> Could anyone make this clear?