Solaris need #define _XPG4_2 for recvmsg()
[tftp-hpa.git] / lib / xmalloc.c
blob6e8ae24ed70dac0dab5d39e026c9563bf6c9903f
1 /*
2 * xmalloc.c
4 * Simple error-checking version of malloc()
6 */
8 #include <stdlib.h>
9 #include <stdio.h>
11 void *xmalloc(size_t size)
13 void *p = malloc(size);
15 if ( !p ) {
16 fprintf(stderr, "Out of memory!\n");
17 exit(128);
20 return p;