summaryrefslogtreecommitdiffstats
path: root/unwind.c
diff options
context:
space:
mode:
Diffstat (limited to 'unwind.c')
-rw-r--r--unwind.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index 9d4c7586..efc321ef 100644
--- a/unwind.c
+++ b/unwind.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <stdarg.h>
#include <signal.h>
+#include <errno.h>
#include "config.h"
#if HAVE_VALGRIND
#include <valgrind/memcheck.h>
@@ -803,6 +804,20 @@ val uw_throwf(val sym, val fmt, ...)
abort();
}
+val uw_ethrowf(val sym, val fmt, ...)
+{
+ va_list vl;
+ val eno = num(errno);
+ val stream = make_string_output_stream();
+
+ va_start (vl, fmt);
+ (void) vformat(stream, fmt, vl);
+ va_end (vl);
+
+ uw_throw(sym, string_set_code(get_string_from_stream(stream), eno));
+ abort();
+}
+
val uw_errorfv(val fmt, struct args *args)
{
val stream = make_string_output_stream();