forked from KolibriOS/kolibrios
libc.obj:
- Formatted by clang-format (WebKit-style). - Removed unnecessary errno linux. - Added KOS error codes. - String functions have been replaced with more optimal ones for x86. - Changed wrappers for 70 sysfunction. git-svn-id: svn://kolibrios.org@9765 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ksys.h>
|
||||
|
||||
void *calloc(size_t num, size_t size) {
|
||||
void *ptr = _ksys_alloc(num*size);
|
||||
if(!ptr){
|
||||
errno = ENOMEM;
|
||||
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);
|
||||
memset(ptr, 0, num * size);
|
||||
return ptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user