2021-04-27 18:33:31 +02:00
|
|
|
#include <stdlib.h>
|
2021-09-13 21:02:24 +02:00
|
|
|
#include <errno.h>
|
2021-04-27 18:33:31 +02:00
|
|
|
#include <sys/ksys.h>
|
|
|
|
|
|
|
|
void *calloc(size_t num, size_t size) {
|
2021-09-13 21:02:24 +02:00
|
|
|
void *ptr = _ksys_alloc(num*size);
|
|
|
|
if(!ptr){
|
|
|
|
errno = ENOMEM;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
memset(ptr, 0, num*size);
|
|
|
|
return ptr;
|
|
|
|
}
|