Re: don't let mmap allocate down to zero

From: Chris Friesen
Date: Wed Jan 26 2005 - 21:17:31 EST


Bryn Reeves wrote:

RETURN VALUE
For calloc() and malloc(), the value returned is a pointer to the
allocated memory, which is suitably aligned for any kind of
variable, or NULL if the request fails.

This could get pretty confusing if NULL was a valid address...

Internally the library can use mmap(). Presumably they will map a MAP_FAILED return code from mmap() to a NULL return code in malloc().

Chris
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/