Collin Funk wrote:
> > The reason is that realloc (p, size) sets errno when failing only when
> > size <= 0x700000000000000; it leaves errno untouched if
> > size > 0x700000000000000.
> >
> > This patch provides a workaround.
> >
> > Collin, if you want to send a bug report to the FreeBSD people, here's
> > my test program:
> > =========================== foo.c ===========================
> > #include <errno.h>
> > #include <stdint.h>
> > #include <stdio.h>
> > #include <stdlib.h>
> > int main (int argc, char *argv[])
> > {
> > size_t b = (argc > 1 ? atol (argv[1]) : PTRDIFF_MAX + 1);
> > errno = 1729;
> > void *p = malloc (1);
> > printf ("p = 0x%lx, errno = %d\n", (unsigned long) p, errno);
> > p = realloc (p, b);
> > printf ("p = 0x%lx, errno = %d\n", (unsigned long) p, errno);
> > }
> > ===============================================================
>
> Sure, I can report it. Thanks.
>
> Whether it will be fixed or not I am unsure.
Did they give you any feedback on this one?
Bruno