+#include <sys/wait.h>
+#include <unistd.h>
+
+/* static */
+
+static void
+bad_malloc(unsigned int size)
+{
+ eprint("fatal: could not malloc() %u bytes\n", size);
+}
+
+/* extern */
+
+void *
+emallocz(unsigned int size)
+{
+ void *res = calloc(1, size);
+
+ if(!res)
+ bad_malloc(size);
+ return res;
+}