kolibrios/programs/develop/ktcc/trunk/libc.obj/source/stdlib/calloc.c
turbocat 4918685b4a libc.obj: Fixed calloc function
git-svn-id: svn://kolibrios.org@9189 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-09-13 19:02:24 +00:00

14 lines
254 B
C

#include <stdlib.h>
#include <errno.h>
#include <sys/ksys.h>
void *calloc(size_t num, size_t size) {
void *ptr = _ksys_alloc(num*size);
if(!ptr){
errno = ENOMEM;
return NULL;
}
memset(ptr, 0, num*size);
return ptr;
}