-static __thread char ebuf[ALTSTACK_ERR_MAXLEN];
-static __thread unsigned elen;
-
-#define bang(x) \
- (elen += snprintf(ebuf + elen, sizeof(ebuf) - elen, \
- "%s(altstack@%d) %s%s%s", \
- elen ? "; " : "", __LINE__, (x), \
- errno ? ": " : "", errno ? strerror(errno) : ""))
+static __thread struct altstack_state {
+ char ebuf[ALTSTACK_ERR_MAXLEN];
+ unsigned elen;
+ jmp_buf jmp;
+ void *rsp_save[2];
+ rlim_t max;
+ void *(*fn)(void *);
+ void *arg, *out;
+} state;
+
+#define bang(x) \
+ (state.elen += snprintf(state.ebuf + state.elen, \
+ sizeof(state.ebuf) - state.elen, \
+ "%s(altstack@%d) %s%s%s", \
+ state.elen ? "; " : "", __LINE__, (x), \
+ errno ? ": " : "", \
+ errno ? strerror(errno) : ""))