Ticket #109: calloc-errno.patch

File calloc-errno.patch, 478 bytes (added by Lukáš Zaoral, 3 years ago)
  • dios/libc/_PDCLIB/glue.c

    diff -u a/dios/libc/_PDCLIB/glue.c b/dios/libc/_PDCLIB/glue.c
    a b  
    101101        void *mem = __vm_obj_make( n * size, _VM_PT_Heap ); // success
    102102        memset( mem, 0, n * size );
    103103        r = mem;
    104     } else
     104    } else {
     105        errno = ENOMEM;
    105106        r = NULL; // failure
     107    }
    106108    __dios_mask( masked );
    107109    return r;
    108110}