Perhaps adding an explicit
void *malloc(size_t size)
{
void *result = mmap((void *) 0, size + sizeof(size_t), PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
if (result == MAP_FAILED)
exit(EXIT_FAILURE);
* (size_t *) result = size;
return(result + sizeof(size_t));
}
would ensure libc isn't trying to do something sneaky,
-Erik
-- Erik B. Andersen http://codepoet-consulting.com/ --This message was written using 73% post-consumer electrons-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/