Malloc bug?

Paul Schinder schinder at pobox.com
Thu Jul 20 03:19:11 EST 2000


At 9:30 AM -0700 7/19/00, William Blew wrote:
>
>Anybody know here man page patches are submitted? After all, if the
>man page is incorrect, an easy fix is to update it :).
>

The man page isn't incorrect, at least not the one I have (YDL CS 1.2):


RETURN VALUES
        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.

        free() returns no value.

        realloc() returns a pointer to the newly allocated memory,
        which is suitably aligned for any kind of variable and may
        be different from ptr, or NULL if the request fails or  if
        size  was  equal  to  0.   If realloc() fails the original
        block is left untouched - it is not freed or moved.

and

NOTES
        The Unix98 standard requires malloc(), calloc(), and real-
        loc()  to  set errno to ENOMEM upon failure. Glibc assumes
        that this is done (and the glibc versions  of  these  rou-
        tines do this); if you use a private malloc implementation
        that does not set errno, then certain library routines may
        fail without having a reason in errno.

>

--
--
Paul Schinder
schinder at pobox.com

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list