Training courses
Kernel and Embedded Linux
Bootlin training courses
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#include <config.h> #undef realloc #undef malloc #include <stdlib.h> #include <errno.h> void * rpl_realloc (void *p, size_t n) { void *result; if (n == 0) { n = 1; } if (p == NULL) { result = malloc (n); } else result = realloc (p, n); if (result == NULL) errno = ENOMEM; return result; }