aboutsummaryrefslogtreecommitdiffstats
path: root/envmemalloc.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-09-02 15:32:56 +0200
committerMattias Andrée <maandree@kth.se>2018-09-02 15:32:56 +0200
commit47128b7def4954c4cf544924c94f018d88033374 (patch)
treec75e6c76c078a095ff691d42a1f0b2d0ea0f0357 /envmemalloc.c
parentAdd malloc function attribute were appropriate (diff)
downloadlibsimple-47128b7def4954c4cf544924c94f018d88033374.tar.gz
libsimple-47128b7def4954c4cf544924c94f018d88033374.tar.bz2
libsimple-47128b7def4954c4cf544924c94f018d88033374.tar.xz
misc
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'envmemalloc.c')
-rw-r--r--envmemalloc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/envmemalloc.c b/envmemalloc.c
new file mode 100644
index 0000000..c500063
--- /dev/null
+++ b/envmemalloc.c
@@ -0,0 +1,29 @@
+/* See LICENSE file for copyright and license details. */
+#include "libsimple.h"
+#ifndef TEST
+
+
+void *
+libsimple_envmemalloc(int status, size_t n, va_list ap) /* TODO test (e[n][v]{mem,array}alloc) */
+{
+ void *ret;
+ int saved_errno = errno;
+ errno = 0;
+ ret = libsimple_vmemalloc(n, ap);
+ if (errno)
+ enprintf(status, "libsimple_vmemalloc:");
+ errno = saved_errno;
+ return ret;
+}
+
+
+#else
+#include "test.h"
+
+int
+main(void)
+{
+ return 0;
+}
+
+#endif