1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #2243 from LudwigOrtmann/native-calloc

native: fix real_calloc, _native_in_calloc  initialization
This commit is contained in:
Ludwig Ortmann 2015-01-14 14:05:06 +01:00
commit c4d4458651

View File

@ -145,7 +145,7 @@ void free(void *ptr)
_native_syscall_leave();
}
int _native_in_calloc;
int _native_in_calloc = 0;
void *calloc(size_t nmemb, size_t size)
{
/* dynamically load calloc when it's needed - this is necessary to
@ -378,6 +378,7 @@ void _native_init_syscalls(void)
*(void **)(&real_read) = dlsym(RTLD_NEXT, "read");
*(void **)(&real_write) = dlsym(RTLD_NEXT, "write");
*(void **)(&real_malloc) = dlsym(RTLD_NEXT, "malloc");
*(void **)(&real_calloc) = dlsym(RTLD_NEXT, "calloc");
*(void **)(&real_realloc) = dlsym(RTLD_NEXT, "realloc");
*(void **)(&real_exit) = dlsym(RTLD_NEXT, "exit");
*(void **)(&real_free) = dlsym(RTLD_NEXT, "free");