logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ecalloc, emalloc, eread, erealloc, esetenv, estrdup, ewrite — exit-on-failure wrapper functions

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);