1ECALLOC(3)               BSD Library Functions Manual               ECALLOC(3)
2

NAME

4     ecalloc, emalloc, eread, erealloc, esetenv, estrdup, ewrite ā€” exit-on-
5     failure wrapper functions
6

LIBRARY

8     The roken library (libroken, -lroken)
9

SYNOPSIS

11     #include <roken.h>
12
13     void *
14     ecalloc(size_t number, size_t size);
15
16     void *
17     emalloc(size_t sz);
18
19     ssize_t
20     eread(int fd, void *buf, size_t nbytes);
21
22     void *
23     erealloc(void *ptr, size_t sz);
24
25     void
26     esetenv(const char *var, const char *val, int rewrite);
27
28     char *
29     estrdup(const char *str);
30
31     ssize_t
32     ewrite(int fd, const void *buf, size_t nbytes);
33

DESCRIPTION

35     These functions do the same as the ones without the ā€œeā€ prefix, but if
36     there is an error they will print a message with errx(3), and exit. For
37     eread and ewrite this is also true for partial data.
38
39     This is useful in applications when there is no need for a more advanced
40     failure mode.
41

SEE ALSO

43     read(2), write(2), calloc(3), errx(3), malloc(3), realloc(3), setenv(3),
44     strdup(3)
45
46HEIMDAL                         August 14, 2003                        HEIMDAL
Impressum