diff options
Diffstat (limited to 'unwind.c')
-rw-r--r-- | unwind.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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(); |