ecalloc, emalloc, eread, erealloc, esetenv, estrdup, ewrite — exit-on-failure wrapper functions
Contents
Description
These functions do the same as the ones without the “e” prefix, but if there is an error they will print
a message with errx(3), and exit. For eread and ewrite this is also true for partial data.
This is useful in applications when there is no need for a more advanced failure mode.
Library
The roken library (libroken, -lroken)
Name
ecalloc, emalloc, eread, erealloc, esetenv, estrdup, ewrite — exit-on-failure wrapper functions
See Also
read(2), write(2), calloc(3), errx(3), malloc(3), realloc(3), setenv(3), strdup(3) HEIMDAL August 14, 2003 ECALLOC(3)
Synopsis
#include<roken.h>void*ecalloc(size_tnumber, size_tsize);
void*emalloc(size_tsz);
ssize_teread(intfd, void*buf, size_tnbytes);
void*erealloc(void*ptr, size_tsz);
voidesetenv(constchar*var, constchar*val, intrewrite);
char*estrdup(constchar*str);
ssize_tewrite(intfd, constvoid*buf, size_tnbytes);
