1 #include "u.h" 2 #include "lib.h" 3 #include "dat.h" 4 #include "fns.h" 5 #include "error.h" 6 7 Label* pwaserror(void)8pwaserror(void) 9 { 10 if(up->nerrlab == NERR) 11 panic("error stack overflow"); 12 return &up->errlab[up->nerrlab++]; 13 } 14 15 void nexterror(void)16nexterror(void) 17 { 18 longjmp(up->errlab[--up->nerrlab].buf, 1); 19 } 20 21 void error(char * e)22error(char *e) 23 { 24 kstrcpy(up->errstr, e, ERRMAX); 25 setjmp(up->errlab[NERR-1].buf); 26 nexterror(); 27 } 28